PDA

View Full Version : how to hide a tab



leidsonmelo
2 Jun 2011, 1:01 PM
Hi.

I have a TabPanel and a I need to hide a tab.

var componenteTabRubricas = new Ext.TabPanel({
id: 'componenteTabRubricas',
activeTab: 0,
enableTabScroll: true,
items: [tab01, tab02]
});

so, how to hide the tab 'tab01'?

skirtle
2 Jun 2011, 10:04 PM
var tab1 = new Ext.Panel({
html: 'tab 1',
title: 'tab 1'
});

var tab2 = new Ext.Panel({
html: 'tab 2',
title: 'tab 2'
});

var tabPanel = new Ext.TabPanel({
activeTab: 0,
height: 300,
items: [tab1, tab2],
renderTo: Ext.getBody(),
width: 300,
tbar: [
{
text: 'Hide',
handler: function() {
tabPanel.activate(tab2);
tabPanel.hideTabStripItem(tab1);
}
}, {
text: 'Show',
handler: function() {
tabPanel.unhideTabStripItem(tab1);
tabPanel.activate(tab1);
}
}
]
});

leidsonmelo
3 Jun 2011, 5:08 AM
Thanks skirtle (http://www.sencha.com/forum/member.php?197255-skirtle)!