Search code examples
extjsextjs4

extjs4 - simplest way to enable/disable tabs in tabpanel?


Is there a simple way to enable/disable tabs in a tabpanel at runtime?

At the moment, I do:

Ext.getCmp('thetabpanel).getTabBar().items.get(1).setDisabled(true);

That seems really complicated, but I can't seem to find any obvious method at the tab panel level to do that directly.

Thanks


Solution

  • You can use the method down to get the tab,

    Ext.getCmp('thetabppanel').down('#itemIdForTheTab').setDisabled(true);
    

    check the documentation for down http://dev.sencha.com/deploy/ext-4.0.2a/docs/#/api/Ext.tab.Panel-method-down