PDA

View Full Version : layout border for panels with percentage values doesn't work



cathoderay
12 Aug 2010, 11:20 AM
In the code below, southPanel and centerPanel do not fit to their percentage height. Once their xtypes are changed from panel to container, they start to obey their percentage values.

I'd like to know why Container and Panel have different behavior in this case. Any idea?

test.js:
====


Ext.onReady(function(){

var southPanel = {
xtype : 'panel',
title : 'south',
region : 'south',
height : '40%',
items : [{
xtype : 'button',
text : 'south'
}]
}

var centerPanel = {
xtype : 'panel',
title : 'center',
region:'center',
items : [{
xtype : 'button',
text : 'center'
}]
}

var myContentPanel = new Ext.Panel({
layout : 'border',
items : [centerPanel, southPanel]
});

var externalPanel = new Ext.Panel({
layout : 'fit',
renderTo: 'divID',
width : 980,
height : 400,
items : myContentPanel
});

});


index.html:
=======


<body>
<div id="divID">
</div>
</body>

ashaihullin
12 Aug 2010, 12:24 PM
i guess here (http://www.sencha.com/forum/showthread.php?48859-OPEN-628-BorderLayout-to-offer-age-initial-sizing-of-border-regions&p=287261#post287261) is about it