Changes between Initial Version and Version 1 of Ticket #7550


Ignore:
Timestamp:
Aug 28, 2008, 3:39:23 PM (12 years ago)
Author:
bill
Comment:

I agree, although it isn't as important an issue as it used to be since it's no longer an issue with _Container based widgets:

destroyDescendants: function(/*Boolean*/ preserveDom){
	dojo.forEach(this.getChildren(), function(child){ child.destroyRecursive(preserveDom); });
},

I suppose this is also something to think about w/ContentPane (actually I mean dojo.html) since that keeps it's own list of widgets and destroys them, thus going top down rather than bottom up.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7550

    • Property Milestone changed from tbd to 1.4
    • Property Summary changed from widget destroy order to Widget: make destroyDescendants() go bottom up
  • Ticket #7550 – Description

    initial v1  
    11I'd like to answer the TODO question... Yes, I'd prefer reversed order of destruction.  Occasionally, when a widget is destroyed I'd like to access the enclosing widget; however, the enclosing widget is already gone.  Typically, objects are destroyed from the inside going outside.
     2{{{
     3destroyDescendants: function(){
     4        // summary:
     5        //              Recursively destroy the children of this widget and their
     6        //              descendants.
    27
    3         destroyDescendants: function(){
    4                 // summary:
    5                 //              Recursively destroy the children of this widget and their
    6                 //              descendants.
    7 
    8                 // TODO: should I destroy in the reverse order, to go bottom up?
    9                 dojo.forEach(this.getDescendants(), function(widget){ widget.destroy(); });
    10         },
     8        // TODO: should I destroy in the reverse order, to go bottom up?
     9        dojo.forEach(this.getDescendants(), function(widget){ widget.destroy(); });
     10},
     11}}}