PDA

View Full Version : Show/Hide a tab panel dinamically



aga@eofbof.it
21 Jan 2015, 1:00 AM
Hello,

i'm wondering how to show/hide a panel dinamically.
This is what's happening.
My client receives a json string in which there's a flag. true or false.

hence, i tried to do something like:


if(jsonstring.manager === false){
Ext.ComponentQuery.query('#tabManageProperties')[0].hide();
} else {
Ext.ComponentQuery.query('#tabManageProperties')[0].show();
}


The tab is, by default, hidden.
Actually this doesn't work. I mean, if i "show" it (the else branch of the if), then the content of the tab is shown, but the "tab button" is not visible on the tab bar.

What i'd like to have is to see the "tab button" appearing on the tab bar, without loosing the focus on the tab that is open in that moment.

Anyone of you have an idea how could i do that? what's the property that should be modified?
Thanks in advance.

lumberjack
23 Jan 2015, 8:24 AM
You'll need to use the tabConfig config property in the tab you want to dynamically show/hide.

Regards,
Brian

h0o