PDA

View Full Version : HBox Layout Problem



legrego
3 Jan 2011, 11:37 AM
Hello,

I am trying to get two Containers to render side-by-side, using the hbox layout. Here is the simplest example of what I am attempting:



this.northBoard = new Ext.Container({
layout: {type: 'hbox', align: 'stretch'},
width: 205,
height: 100,
items: [
{xtype: 'container', width:100, height:100},
{xtype: 'container', width:100, height:100}
]

});
It seems that no matter what I try, the second container will render under the first container. I have tried each "align" attribute, including leaving it out, to no avail.

How do I resolve this?

alg
4 Jan 2011, 4:41 AM
Try:


this.northBoard = new Ext.Container({
layout: {type: 'hbox', align: 'stretch'},
width: 205,
height: 100,
items: [
{xtype: 'container', width:100, height:100, flex: 1},
{xtype: 'container', width:100, height:100, flex: 1}
]

});