PDA

View Full Version : Floating panel resize on orientation change



uhuru
7 Feb 2011, 12:21 AM
Hi. I have a nested list that shows on a button click.

I set its size this way:


width: Ext.Element.getViewportWidth()*0.75,
height: Ext.Element.getViewportHeight()*0.9,

Now, if I start the application with my mobile in vertical orientation and i change orientation the nestedlist size won't change. I've tried with "onorientationchange:" but had no succes. Can anyone help with that? thanks

EDIT: Finally i've been able with:

orientationchange: function(nestedList, orientation, width, height){
if(orientation=="landscape"){
nestedList.setWidth(Ext.Element.getViewportWidth()*0.9);
nestedList.setHeight(Ext.Element.getViewportHeight()*0.8);
}else if (orientation=="portrait"){
nestedList.setWidth(Ext.Element.getViewportWidth()*0.75);
nestedList.setHeight(Ext.Element.getViewportHeight()*0.95);
}
}