PDA

View Full Version : Hide/Show Panel's component



hieu79vn
18 Apr 2012, 6:26 AM
Hello

I have a a tab panel which contain 2 panel (1 grid panel and 1 normal panel). The normal panel contains 1 form panel and a grid panel. I set closable:true, closeAction :'hide' to normal panel. So when user close the 2e tab (which contains the normal panel), it will be closed correctly. But when users reopen the 2e tab, I show it with
tabPanel.add(panel).show();
tabPanel.setActiveTab(panel);

but it seems that only the title of 2e tab panel is showed. The form panel and grid panel are not showed.
I have tried to do
formPanel.show() and detailGrid.show() but it doesn't work

How could I do that?

Thank you

scottmartin
18 Apr 2012, 8:45 PM
It is hard to determine what the problem is without code. Have a look at the following example from the API



var tabs = Ext.create('Ext.tab.Panel', {
width: 400,
height: 400,
renderTo: document.body,
items: [{
title: 'Home',
html: 'Home',
itemId: 'home'
}, {
title: 'Users',
html: 'Users',
itemId: 'users',
hidden: true
}, {
title: 'Tickets',
html: 'Tickets',
itemId: 'tickets'
}]
});

// remove home tab; show hidden tab: users
setTimeout(function(){
tabs.child('#home').tab.hide();
var users = tabs.child('#users');
users.tab.show();
tabs.setActiveTab(users);
}, 1000);

// no place like home .. time to bring it back.
setTimeout(function(){
var home = tabs.child('#home');
home.tab.show();
tabs.setActiveTab(home);
}, 1000);


Regards,
Scott.