JavaScript Document (8) Events (8) ExtJS (9) Strings (3)
Exchange Links About this site Links to us 
|
Closing an extjs window closes / destroys components displayed in it
1 comments. Current rating: (1 votes). Leave comments and/ or rate it.
I found out that if you have a component that is displayed in a window,
and you close that window, then the component gets released (free'd, cleared, destroyed, you name it).
This makes sense if the component was created in the scope of the window,
but it is a bit of a surprise in a situation like below.
Then when you close the window referenced by (win), the grid referenced by (myglobalgrid) is destroyed.
If you run the window creating code a second time, you need to create the grid freshly as well.
I was quite surprised by that.
 | |  | | var myglobalgrid = new Grid({ .. });
var win = new Window({
[..]
items: [myglobalgrid]
}
| |  | |  |
Comments:
|
[hidden] from Germany
|
 |
|
Have a look at Ext.Container's autoDestroy config option: http://extjs.com/de..utoDestroy - setting this to false for the window (or the Panel, that the grid is the direct child of) will not auto-destroy your grid.
Also have a look at Ext.Windows's closeAction config option: http://extjs.com/de..loseAction setting this to 'hide' does not destroys your window when the user closes it but only hides it. So you just can re-open the window a second time.
|
|