2011-11-01 13 views

答えて

19

ここにドキュメントを読む:http://docs.sencha.com/ext-js/4-0/#!/api/Ext.tab.Panel

を彼らは、タブのリンクから抽出

を非表示にする方法の具体的な例を与える:

var tabs = Ext.create('Ext.tab.Panel', { 
    width: 400, 
    height: 400, 
    renderTo: document.body, 
    items: [{ 
      title: 'Home', 
      html: 'Home', 
      itemId: 'home' 
     }, { 
      title: 'Users', 
      html: 'Users', 
      itemId: 'users', 
      hidden: true 
     }, { 
      title: 'Tickets', 
      html: 'Tickets', 
      itemId: 'tickets' 
     }] 
}); 
setTimeout(function() { 
    tabs.child('#home') 
     .tab.hide(); 
    var users = tabs.child('#users'); 
    users.tab.show(); 
    tabs.setActiveTab(users); 
}, 1000); 
+0

Iはtabs.hideTabStripItem(<非表示にするタブ>)とtabs.unhideTabStripItem(<表示するタブ>)を使用しました –

-3

はこれが有効/無効にタブの内容に私の例であります。

この例では、「Desabilitar」という名前のボタンがあり、そのボタンをクリックするとタブの最初の子が無効になります。 タブの内容は9秒後に有効になります。あなたのタブパネルはIDを持っている、とコンポーネントがIDやアイテムのIDを持っている場合は、次の操作を行うことができます

https://fiddle.sencha.com/fiddle/21h/preview

1

:。Ext.getCmp( 'TAB_PANEL_ID')getComponent( 'ITEM_ID')tab.hide()。

たとえば、

var tabPanel = Ext.create("Ext.tab.Panel", { 
       id: 'TAB_PANEL_ID', 
       renderTo: Ext.getBody(), 
       items:[{ 
        title: 'Tab 1', 
        itemId: 'TAB_1', 
        html: 'This is the first tab' 
       },{ 
        title: 'Tab 2', 
        itemId: 'TAB_2', 
        html: 'This is the second tab'          
       },{ 
        title: 'Tab 3', 
        itemId: 'TAB_3', 
        html: 'This is the third tab'       
      }]     
}); 

// You may want to add following in function body or inside event handler. 
// Hide the second tab:  
Ext.getCmp('TAB_PANEL_ID').getComponent('TAB_2').tab.hide(); 

// Show the second tab: 
Ext.getCmp('TAB_PANEL_ID').getComponent('TAB_2').tab.show(); 
関連する問題