View Full Version : Window isn't really destroyed... ?

12 Oct 2011, 6:44 AM

I've tried to recreate the "Desktop application" example : I've made a windows manager which is actually just an easy array indexed by the id of the window that will be created so I never reopen an already opened window (it could be minimized, so instead of reopening it, I maximize it). The indexed array stores the Ext.Window object

Everything works almost as expected..... if I open a window and I close it, then I open it again, the x and y parameters (coords) will be reset !

My window launcher specifies the x and y parameters, but after the first run, it's like if it's ignored !
Doing a console.log of my window after it has been closed (destroyed) says undefined so it's actually really destroyed, but then, why the hell my x and y parameters are ignored whereas I redefine it ???

Here is some code of it :

The icon launcher :

Ext.get("icone1").on("click", function(){
Desktop.openNewWindow("id_window" , "css_test", "title..." , {x:500,y:500,width: 400, height: 420, html:Ext.get("blabla").dom.innerHTML});

This works : the window is opened (my openNewWindow is my own stuff method of my own class Desktop), with correct X and Y params.

Now, if i close this window, it gets closed, console.log( Ext.getCmp("id_window")); returns undefined....the window appears to be in void.

Now, if i reclick on my launcher.......the x and y are ignored, instead, it sticks to the top left corner of the browser...
note that closeAction is set to destroy (anyway, by default it's also set to destroy....)
note also that i didn't redefined destroy function. I've just added a listener for destroy and added some stuff related to the task bar (on a window close, I have to remove the button which symbolize the opened window).

Anybody has an idea ?

12 Oct 2011, 7:57 AM
The almost same issue occurs for the width and height !! The values of the width and height after a open/close stay the same :

There's a window that opens from the same shortcut, but opens with specific parameters depending on other stuff.
So the content, the title, the width, the height, the x and y parameters must change.

The title and the content indeed change, but not the width,height,x and y !! Why ?? Am I missing something obvious ??

16 Oct 2011, 11:19 PM
If somebody is interested in this issue (it seems noone is but whatever...)....here is a hint

My problem is related to the animateTarget.

As I said, I tried to recreate a web desktop....hence, I have a taskbar (which is a Ext.toolbar.Toolbar) and I link my window to this taskbar to recreate the animation effect (as if the window pops out from the taskbar). When I disable the animateTarget property in my window object, the bug disappears...

6 Jun 2014, 4:35 AM
I'm getting into this issue too with 4.1.3

If I call win.show(myEl) then Window is not destroyed on close
If I call win.show() then Window is destroyed on close

In step-by-step DEBUG everything seem to work fine. When removing breakpoints, runing into issue...

Sometimes, the window is destroyed when using animateTarget, and we trying to open a new one, it stays invisible (x-hide-offset and left/right =-10000)