PDA

View Full Version : [4.1.1] Ext.window.Window.getPosition() in beforeDestroy [-10000, -10000]



Ex_Soft
18 Jul 2012, 6:13 AM
Ext.onReady(function() {
Ext.create("Ext.window.Window", {
x: 100,
y: 100,
height: 100,
width: 100,
html: "html",
listeners: {
beforeclose: function(win, eOpts) {
if(window.console && console.log)
console.log("Ext.window.Window.beforeclose() getPosition(false)=%o, getPosition(true)=%o, height=%i, width=%i, x=%i, y=%i", win.getPosition(false), win.getPosition(true), win.height, win.width, win.x, win.y);
},
beforedestroy: function(win, eOpts) {
if(window.console && console.log)
console.log("Ext.window.Window.beforedestroy() getPosition(false)=%o, getPosition(true)=%o, height=%i, width=%i, x=%i, y=%i", win.getPosition(false), win.getPosition(true), win.height, win.width, win.x, win.y);
}
}
}).show();
});

4.1.1 getPosition() returns [-10000, -10000]. Why?

P.S. 4.0.7 works fine.

P.P.S. http://jsfiddle.net/pP9d2/

Romick
18 Jul 2012, 6:42 AM
Because, actualy 'beforedestroy' fires after component was hided.
beforehidefires before beforedestroy.

.x-hidden, .x-hide-offsets {
display: block !important;
left: -10000px !important;
position: absolute !important;
top: -10000px !important;
visibility: hidden !important;
}

But in win object there are still win.x and win.y. Why don't you use them?
Hope this can help you.

Ex_Soft
18 Jul 2012, 6:58 AM
But in win object there are still win.x and win.y. Why don't you use them?
I know. I've been starting to use.