PDA

View Full Version : Tab body not accessible if hidden



adm660
7 Mar 2008, 2:53 AM
Hi everyone,

I got the following gui application:
Ext.Window
-> Ext.TabPanel
-> Tabs...

When the window is hidden, I can't access the body content of the dinamically generated tabs.

I tried to switch between any different hideModes without any success.

Here is an example, where tabItem is an item of a TabPanel which is itself contained in an Ext.Window:


function checkTabItemBodyWhenHidden(tabItem)
{
alert(tabItem.body);
}


When window is hidden, tabItem.body returns undefined...

Any idea ?

hendricd
7 Mar 2008, 5:38 AM
It's not clear where you are deriving tabItem from, but give that item an id, and access it directly:



function checkTabItemBodyWhenHidden(tabItemId)
{
var tab;
if(tab = Ext.getCmp(tabItemId) && tab.rendered){
alert(tab.title);
}
}
What do you get then?

Animal
7 Mar 2008, 5:49 AM
If it has not been rendered, then it will be undefined.

See http://extjs.com/deploy/dev/docs/?class=Ext.TabPanel&member=deferredRender. Only what must be rendered is rendered.