Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

extjs

extjs4

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

like image 971
Ben Avatar asked Sep 14 '11 10:09

Ben


1 Answers

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

like image 146
nscrob Avatar answered Sep 29 '22 19:09

nscrob