DelphiFAQ Home Search:

Closing an extjs window closes / destroys components displayed in it

 

comments2 comments. Current rating: 4 stars (2 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]
}


Content-type: text/html

Comments:

2008-08-08, 09:39:07
[hidden] from Germany  
rating
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.
2011-09-27, 23:47:35
pooja_garg14@yahoo.com from India  
rating
hey I am using window.close() method but after closing the form m not getting the form opening back on clicking the button.....!!

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: