PDA

View Full Version : Window width before maximize



xbboys
1 Aug 2010, 5:21 PM
Hey guys,

Does anyone know how to get the initial width of the window when I maximize the window? I tried using win.getWidth() in maximize listener but it returns the width of after maximizing?



listeners: {
'maximize': function() {
var win_width = this.getWidth();
}
}


Also, when a Ext.Window is maximized, if we resize our browser, does it fire the Ext.Window resize event?

Condor
2 Aug 2010, 1:47 AM
var win_width = this.restoreSize.width;

xbboys
4 Aug 2010, 5:58 PM
That works! Exactly what I wanted. Thanks...

xbboys
4 Aug 2010, 6:33 PM
One more thing. How do I check if the window is maximized? I tried this.maximized but it kept returning true.

Condor
4 Aug 2010, 11:27 PM
Checking maximized is correct. It must be a problem with your code.

xbboys
5 Aug 2010, 12:07 AM
Looked through but still not sure what I did wrong. I tried resizing the window, maximize, restore, minimize etc. and it's all returning true.


Ext.Window.override ({
listeners: {
'resize': function() {
if(this.maximized) {
...
}
}
}
});

Condor
5 Aug 2010, 12:10 AM
The resize event if fired before the maximized flag is reset. You should be using the maximize and restore events instead.

xbboys
5 Aug 2010, 1:27 AM
OK. Thanks...