ExtJS: destroy the window with the configuration 'closeAction' set to 'hide'

I have a window with closeAction configured to 'hide' when instantiating:

 var myWin = Ext.create('Ext.window.Window', { ... closeAction:'hide', ... }); 

Calling close() on myWin , so it just hides the window. I need to destroy the window in the sense of destroy , as implied by Sencha docs:

remove the window from the DOM and destroy it and all descendants of the Component. The window will not be available for re-display through the show method.

What have i tried? I tried:

  • calling destroy directly on the window object:

     myWin.destroy(); 
  • setting closeAction to destroy before calling close() :

     win.closeAction='destroy'; win.close(); 

In both cases, myWin just hiding, not being destroyed. Any thoughts?

+4
source share
2 answers

The destroy() method must successfully remove the window object from the DOM. To illustrate this, you can check out the basic example in JSFiddle .

After calling myWin.destroy() structure is cleared, and it becomes impossible to myWin.show() window using myWin.show() .

+6
source

You want to destroy window.use below code

 Ext.getCmp('Window Id').destroy(); 
+1
source

All Articles