PDA

View Full Version : [4.1.x] Ext.layout.container.Border how to get region



Ex_Soft
10 Jul 2012, 2:56 AM
4.0.7


regionCenter = vp.getLayout().regions.center;
regionWest = vp.getLayout().regions.west;

4.1.x


regionCenter = vp.getLayout().centerRegion;
regionWest = ???;

sword-it
10 Jul 2012, 4:32 AM
Hi,
I have define a custom code to find the region item. Reivew the following code:



var layoutItems = yourPanel.getLayout().getLayoutItems();
// yourPanel is the panel which contains the border layout
for(var i=0,totalItems=layoutItems .length;i<totalItems;i++){
if(layoutItems [i].region == 'west'){ // region may be - east, west, north, south, center
// do your needful.
}
}

Ex_Soft
10 Jul 2012, 4:42 AM
.getLayout().getLayoutItems();

THNX

friend
10 Jul 2012, 5:32 AM
And as yet another alternative:



var westRegion = Ext.ComponentQuery.query('viewport > panel[region="west"]')[0];