PDA

View Full Version : Border layout inside window fails if no hard coded height set



Jangla
30 Apr 2013, 12:19 AM
Have a look at these two chunks of code:



Ext.create( 'Ext.Window', {
title : 'Window Header',
width : 500,
layout : {
type : 'border'
},
items : [
{
region : 'center',
html : 'CENTER REGION'
},
{
region : 'east',
collapsible : true,
width : 200,
html : 'RIGHT REGION'
}
]
} ).show();






Ext.create( 'Ext.Window', {
title : 'Window Header',
height : 500,
width : 500,
layout : {
type : 'border'
},
items : [
{
region : 'center',
html : 'CENTER REGION'
},
{
region : 'east',
collapsible : true,
width : 200,
html : 'RIGHT REGION'
}
]
} ).show();




Only difference is the second one has a height in the centre panel.

The first one will generate a 'Layout run failed' error though. Not very helpful when you don't want to hard code the height but rather have the layout size according to it's content.

slemmon
1 May 2013, 2:21 PM
Yes, with the border layout you'll need a bit more to go on than just width.