PDA

View Full Version : [SOLVED] Panel disappears when TabPanel context menu is shown



ko0kiE
25 Nov 2007, 5:56 PM
I set up an context menu for my tabpanel but everytime the context menu is shown, the panel content disappears or is resized to 0.. whatever I just can't see the content anymore..

anyone knows where's the problem there?


ps: context menu is shown with menu.showAt( e.xy)

efege
25 Nov 2007, 6:00 PM
Can you please post/link some small test case where we can see that behavior?

ko0kiE
26 Nov 2007, 7:44 AM
ok, I isolated the whole part with the TabPanel.. took a little bit effort to got that running, because there are a lot of dependencies with which I don't wanna bother you.
and after all, I did find out, why this behavious occurs, but couldn't find a proper way to solve it..

I did use this code...


this.objectPanel = new Ext.Panel( {
renderTo: panel.body,
layout: 'border',
items : [ {
region : 'west',
id : Ext.id(),
split : true,
width : 200,
height: 500,
layout : 'accordion',
layoutConfig : {
animate : true
},
items : [ {
id : 'objects-panel',
title : 'Objects',
autoScroll : true,
border : false
}, {
id: 'hvf-panel',
title : 'HVF',
border : false,
autoScroll : true
}]
}, {
id: 'desk-panel',
region : 'center',
bodyBorder: false,
layout : 'fit'
}]
});


especially this line is important: renderTo: panel.body

'panel' is a Ext.Panel, where this new Panel should rendered into.. I have to that this way, because the layout can be changed and we don't know it until the tab is actually selected.

the behaviour didn't occur in my isolated test if I defined the layout directly on the Panel added to the TabPanel..

so my question is... How do I add an single Panel with a complex layout within a Panel which is already added to the tabpanel?

with that renderTo config option it looked ok, but the above behaviour occured..

with panel.add( new Ext.Panel {...}) it doesn't show up..

hendricd
26 Nov 2007, 7:57 AM
Anytime you add a panel to a parent Panel (or descendant) that has already been rendered, you'll need to call parentPanel.doLayout() after adding to it.

ko0kiE
26 Nov 2007, 8:25 AM
thanks.. that was the key hint! (: