PDA

View Full Version : onWindowResize called twice ?



duskandawn
11 Aug 2010, 8:53 AM
Hello,
Am trying to capture the browser window resize for resizing my panel accordingly.

My code looks like :


<div id="GridArea"> </div>
var cardWizard = new Ext.Panel({
id:'Application',
layout:'card',
activeItem: 0,
renderTo: 'GridArea',
layoutOnTabChange : true,
monitorResize : true,
items: [{
itemId: 'PanelArea',
hideMode: 'offsets',
xtype: 'searchPanel'
}]
});
Ext.EventManager.onWindowResize(testMe,cardWizard);

function testMe(){
//alert("test" + Ext.getBody().getHeight());
alert("testafter1");
var h = Ext.getBody().getHeight() - 100;
alert("testafter2");
var w = Ext.getBody().getWidth() - 100;
cardWizard.setSize(w,h);
alert("testafter3");
cardWizard.doLayout();
}
});



When i try to resize browser window, i see the testMe function is being called twice, as i see all the alert boxes.
Also in first call, it does resize my panel, but in next call it brings it back to some random size, not sure why.

Any ideas ?

Thank you

Animal
11 Aug 2010, 9:25 AM
Posting multiple times!

Not good for gett =ing people to want to heolp you!

duskandawn
11 Aug 2010, 9:51 AM
Am really sorry, i didnt mean to post multiple times, when i click post thread it didnt give me any notifcation of thread being posted.
Sorry about that.