PDA

View Full Version : Border layout - north/south can't get height as percentage



dekely
8 Jul 2013, 12:26 AM
Hi All,
I'm using Ext 3.4
I'm trying to build a panel with layout: 'border'.
When I define height/width as percentage, it works only for east/west regions.
Is it possible to specify percentage for west/east as well?
thanks for the help



Ext.onReady(function(){
var myBorderPanel = new Ext.Panel({
renderTo: document.body,
width: 700,
height: 500,
title: 'Border Layout',
layout: 'border',
items: [{
title: 'south',
region: 'south',
height: '50%',
collapsible: true
},{
title: 'north',
region: 'north',
height: 100,
collapsible: true
},{
title: 'east',
region: 'east',
width: '50%',
collapsible: true
},{
title: 'west',
region:'west',
width: 200,
collapsible: true
},{
title: 'center',
region: 'center'
}]
});
});

mitchellsimoens
9 Jul 2013, 12:35 PM
Border layout doesn't support percentage sizing, it needs actual pixels

dekely
10 Jul 2013, 1:27 AM
But it does work for east/west regions.

willigogs
10 Jul 2013, 1:02 PM
You could still achieve what you want by using an HBox layout and flex values instead :)

dekely
10 Jul 2013, 11:50 PM
But they don't have splitters.

willigogs
11 Jul 2013, 12:53 AM
In that case, I can't find the original thread on these forums - but the following override might help:
http://www.yannlaviolette.com/2010/02/borderlayout-using-percentage-values.html