PDA

View Full Version : height and width in percentage



deepak_patil1222
29 Nov 2012, 11:03 PM
how to give the percentage width config for container and panels in ExtJS ??? sencha touch allows for the same whereas i am not able to give the height/width in percentage with respect to parent contaiener inn ExtJS.

any idea would be helpfull.

sword-it
30 Nov 2012, 1:32 AM
Hi Deepak,

If you want to give height and width in %, use anchor layout like-


Ext.create('Ext.Panel', {
width: 500,
height: 400,
title: "AnchorLayout Panel",
layout: 'anchor',
renderTo: Ext.getBody(),
items: [
{
xtype: 'panel',
title: '75% Width and 20% Height',
anchor: '75% 20%'
},
{
xtype: 'panel',
title: '100% Width and 50% Height',
anchor: '100% 50%'
},
{
xtype: 'panel',
title: '100% Width and 30% Height',
anchor: '100%0 30%'
}
]
});