PDA

View Full Version : hide()-Question



konki_vienna
26 Nov 2010, 5:00 AM
I do have a container which has two container-items as children.



home1 = new Ext.Panel({
flex: 1,
cls: 'home1 borderBlue',
html: 'Home 1 Placeholder'
});

home2 = new Ext.Panel({
flex: 1,
cls: 'home2 borderBlue',
html: 'Home 2 Placeholder'
});

...

{
xtype: 'container',
flex: 6,
layout: {
type: 'hbox',
align: 'stretch'
},
items: [home1, home2]
}
If I hide 'home2'


home2.hide();
and do an update afterwards, the space of the 'home2'-component stays empty and does not get filled by the 'home1'-item which I would like to achieve.

Why is that? Or how can I achieve it differently (without removing/adding the 'home2'-component?
Thanx for help!

Steffen Hiller
26 Nov 2010, 7:49 AM
Try yourContainer.doLayout(); after you hide the child item.

jay@moduscreate.com
26 Nov 2010, 7:49 AM
call home1.ownerCt.doLayout() after home2.hide();

jay@moduscreate.com
26 Nov 2010, 7:50 AM
http://tdg-i.com/img/screencasts/2010-11-26_1049.png

Steffen Hiller
26 Nov 2010, 7:52 AM
High five! :-D

jay@moduscreate.com
26 Nov 2010, 7:55 AM
High five! :-D

:D

http://www.youtube.com/watch?v=EM2Xm2hMVR8