2011-11-01 22 views

Respuesta

19

Lea la documentación aquí: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.tab.Panel

Ellos dan un ejemplo específico de cómo ocultar las pestañas

Extraído de enlace:

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 utilizarse tabs.hideTabStripItem () y tabs.unhideTabStripItem () –

-3

Este es mi ejemplo para activar/desactivar el contenido de la pestaña .

En este ejemplo, tenemos un botón llamado "Desabilitar", haga clic en él y se desactivará el primer elemento secundario de la pestaña. El contenido de la pestaña se habilitará en 9 segundos.

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

1

Si su panel de pestañas tiene ID, y los componentes tienen identificación o ID de artículo, puede hacer lo siguiente:.. Ext.getCmp ('TAB_PANEL_ID') getComponent ('ITEM_ID') tab.hide()

Por ejemplo,

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();