This is my TabPanel code:
inside the code there are two tabs (tab1 and tab2) in TabPanel (tabs_panel)
MyTabPanelUi = Ext.extend(Ext.TabPanel, { activeTab: 0, height: 210, resizeTabs: true, tabWidth: 266, id: 'tabs_panel', initComponent: function () { this.items = [{ xtype: 'panel', title: 'Project', padding: 20, height: 150, id: 'tab1' }, { xtype: 'panel', title: 'Service', height: 150, padding: 20, id: 'tab2' }] } });
I am trying to hide tab2 using the following code, but this code below
var tabPanel = Ext.getCmp('tabs_panel'); var tabToHide = Ext.getCmp('tab2'); tabPanel.hideTabStripItem(tabToHide);
but somehow this code does not work for me. How can I fix the problem?
source share