PDA

View Full Version : Constrained, maximized window in panel body act strange on browser resize



Tewr
7 Aug 2009, 1:19 AM
My app has begun to behave slightly weird after upgrading to 3.0, but it's annoying enough for me to take the time to write a thread about it :P

I create a constrained window, rendered inside a panel body. Thereason for putting it in a panel body is that the panel would have a bottom and top toolbar with menus etc, to get that MDI-style feeling. If I maximize the window, I do not want these toolbars to be covered by the window.

However, since upgrading to 3.0, the window doesn't resize correctly when maximized, and the browser window is resized. This is most obvious when you do the following:
- Maximize the constrained window
- Restore the browser window
- Maximize the browser window

The constrained window is either not resized at all, or resized badly, as if the resize event that the window listens to was to early or to late. I have tested this in FF3.5 and IE8.

Here is some code that demonstrates this behaviour:


Ext.onReady(function() {
var testPanel = new Ext.Panel({
listeners: { 'render': function() {
new Ext.Window({
title: 'Test window not resizing correctly when browser is resized (when maximized)',
html: 'Test Content',
maximizable: true,
constrainHeader: true,
renderTo: testPanel.body
}).show();

new Ext.Window({
title: 'Test window resizing correctly when maximized(in document body)',
html: 'Test Content',
maximizable: true,
}).show();
} }
});

new Ext.Viewport({
layout: 'fit',
items: [testPanel]
});
});Anyways... I am guessing I am doing something wrong here, that worked in 2.2 but was wrong still :). If it's an error, the error obviously lies in
renderTo: testPanel.body Thus my question; is there another way of achieving this... that works? I am thankful for any suggestions.

Video link: http://www.screencast.com/users/TewrJing/folders/Jing/media/a2cdc2cb-f746-4867-bea1-65c5f6ba719a

wexman
18 Oct 2010, 12:20 AM
I have the very same problem here. Did you find a solution for this?

Animal
18 Oct 2010, 1:12 AM
I can't look into it right now, but I suspect a problem with Ext.EventManager's window resize system which fires the event on a delay.

If you programatically call fitParent (which is what the Window class does on browser window resize), its jumps to the correct size. So I think the code in the Window class is correct. It's the underlying platform that's got a problem.