PDA

View Full Version : How to close a Ext.window?



chenzhaoplus
29 Mar 2012, 11:04 PM
how to close a Ext.window?
what's the difference between close() and destroy()?

evant
30 Mar 2012, 12:45 AM
It's all in the docs:



Closes the Panel. By default, this method, removes it from the DOM, destroys the Panel object and all its descendant Components. The beforeclose event is fired before the close happens and will cancel the close action if it returns false.

Note: This method is also affected by the closeAction setting. For more explicit control use destroy and hide methods.

Jad
30 Mar 2012, 12:45 AM
Hello
The close method fired an event.

vietits
30 Mar 2012, 12:48 AM
1. To close a window, just call <window>.close()
2. <window>.destroy() will destroy the window. Default action of close() is the same as destroy(). You can change behavior of close() by setting closeAction to 'hide' or 'destroy'. Also, close() will fire beforeclose event that allows you to cancel close action.