How to programmatically set a hidden property for Tab (button)

I have an Ext TabPanel and am trying to set a hidden property for one of the tabs programmatically. I can select the object and call methods, such as disable () and enable (), but so far I have not been able to find a means by which I can manipulate the hidden Tab property.

Tab is defined as

{ id: "view-task", hidden: false, title: "View" } 

and code trying to manipulate it

 twin = ( Ext.getCmp('view-task')); twin.disable(); 

The above call is for disabling work, so the component is correctly selected, but I do not know how to manipulate the hidden property.

Any help would be greatly appreciated.

N. Euzebe

+4
source share
2 answers

Try the following:

 var tabs = Ext.createWidget('tabpanel', { items: [{ itemId: 'home', contentEl:'script', title: 'Short Text', closable: true }] }); tabs.child('#home').tab.hide(); 

This code can be found in the examples on the API page.

+4
source

You did not explain which version of ExtJS you are using. But in version 3.x you can do the following (I don't know, but it can also work in ExtJS 4.x):

 var tabPanel = Ext.getCmp('myTabPanel'); var tabToHide = Ext.getCmp('myTab'); tabPanel.hideTabStripItem(tabToHide); 

To display the tab again:

 tabPanel.unhideTabStripItem(tabToHide); 

Hope this helps you :)

+2
source

Source: https://habr.com/ru/post/1389666/


All Articles