PDA

View Full Version : Can child not have column layout if parent (or any of its ancestor) has hbox layout?



netemp
13 May 2012, 11:14 PM
Following code has been created by modifying one of the examples:






Ext.onReady(function () {
Ext.create('Ext.panel.Panel', {
title: 'HBox Layout - Column Layout',
width: 350,
height: 250,
layout:'hbox',// 1 - MAIN PANEL layout is HBOX
items: [
{
xtype:'container',
layout:'column',// 2 - CONTAINER layout is COLUMN
items:[
{
title: 'Column 1',
columnWidth: 0.25
},{
title: 'Column 2',
columnWidth: 0.55
},{
title: 'Column 3',
columnWidth: 0.20
}
]
}
],
renderTo: Ext.getBody()
});
});



The above code does not display any of the child panels (Column1, Column2 or Column3) unless we change the layout Main Panel from HBox to something else.


This is true even if there is one more component present in between Main Panel and Container with layout different from hbox.


It seems that if any of the component has a layout of HBox then neither its children nor any child of its children is allowed to have a column layout. Is this correct or are we doing something wrong here?


Could anyone guide at this?

Thanks in advance.

15 May 2012, 10:01 AM
Your problem is that you're not setting a size for your child container :)

netemp
15 May 2012, 10:19 PM
Yeah :) Agreed. Realized the same later.

Thanks for the time though Jay.