I have a window with closeAction
configured to 'hide'
on instantiation:
var myWin = Ext.create('Ext.window.Window', {
...
closeAction:'hide',
...
});
Calling close()
on myWin
therefore simply hides the window. I need to destroy the window in the sense of destroy
as implied by the Sencha docs:
remove the window from the DOM and destroy it and all descendant Components. The window will not be available to be redisplayed via the show method.
What did I try? I tried:
calling
destroy
directly on the window object:myWin.destroy();
setting
closeAction
todestroy
prior to callingclose()
:win.closeAction='destroy'; win.close();
In both cases, myWin
is simply hidden rather than destroyed. Any thoughts?
I have a window with closeAction
configured to 'hide'
on instantiation:
var myWin = Ext.create('Ext.window.Window', {
...
closeAction:'hide',
...
});
Calling close()
on myWin
therefore simply hides the window. I need to destroy the window in the sense of destroy
as implied by the Sencha docs:
remove the window from the DOM and destroy it and all descendant Components. The window will not be available to be redisplayed via the show method.
What did I try? I tried:
calling
destroy
directly on the window object:myWin.destroy();
setting
closeAction
todestroy
prior to callingclose()
:win.closeAction='destroy'; win.close();
In both cases, myWin
is simply hidden rather than destroyed. Any thoughts?
2 Answers
Reset to default 10Method destroy()
should successfully remove the window object from the DOM. In order to illustrate this you can check the basic example in JSFiddle.
After calling myWin.destroy()
the structure is cleared and it becomes not possible to reinvoke the window with myWin.show()
.
Are you want to destroy the window.use below code
Ext.getCmp('Window Id').destroy();
destroy()
it is perfectly destroyed: jsfiddle.net/5BcBd/1. – VisioN Commented Mar 8, 2013 at 11:55body
before and after removal. Typically you may use Chrome DevTools or Firebug for that. In case ofdestroy()
the DOM structure is removed and if you try to callshow()
afterwards, the JS will raise an error. – VisioN Commented Mar 8, 2013 at 13:46destroy()
in my question is incorrect - I'll mark your answer as the correct answer. Thanks! – Joseph Victor Zammit Commented Mar 8, 2013 at 14:32