Opened 11 years ago

Closed 9 years ago

#7668 closed defect (fixed)

If the GridContainer is placed in a border container, it is not removed when the border container is removed.

Reported by: spidey2099 Owned by: dante
Priority: high Milestone: 1.6
Component: Dojox Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description

Note: all these test take place asynchronously . The base layout is a border container with an expando on the left, another expando on the bottom and a content pane in the center.

The user clicks on a button to add a border container with a grid container into the center content pane of the base layout. This works as expected.

However, if the button to remove a layout is clicked, the grid appears to be removed but it's parent border container is not removed. So if the user goes to add the grid container again dojo states that the id of the first content pane "0.3.2" is still registered. If all content from the grid is removed (no content panes) the grid and it's parent border container can be removed and re-added successfully.

Attachments (2)

dojo-1.1-Test-1-AsyncGrid.html (9.9 KB) - added by spidey2099 11 years ago.
This is the original code which exhibits the problem. It has some changes, as recommended by dante.
gc.html (5.2 KB) - added by spidey2099 11 years ago.
This is the modified test by dante, indicating the changes needed to fix the problems.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by spidey2099

This is the original code which exhibits the problem. It has some changes, as recommended by dante.

Changed 11 years ago by spidey2099

Attachment: gc.html added

This is the modified test by dante, indicating the changes needed to fix the problems.

comment:1 Changed 11 years ago by Adam Peller

Owner: changed from Adam Peller to dante

comment:2 Changed 11 years ago by dante

Milestone: tbd1.3
Status: newassigned

the entirety of the issue seems to be that GridContainer?.destroyRecursive() doesn't destroy the children or splitters, so anything re-registered throws duplicate ID warnings. If you leave off the ID, everything "works", but leaves lots of mess for GC to take care of.

comment:3 Changed 11 years ago by dante

Milestone: 1.31.4

need to re-investigate this. there is a chance it has been fixed with the contentpane changes in 1.2.x ...

comment:4 Changed 10 years ago by dante

Milestone: 1.41.5

spidey - is this still a problem in your app? Not time left in 1.4

comment:5 Changed 10 years ago by Mathevet julien

If you apply this patch #10304 and call only destroyRecursive:

 function removeGrid(tnode) {
	var node = dijit.byId(tnode); 
	console.log("Removing layout : " + node, 'tnod: ', tnode);
	// FIXME: BUG/hack: why isn't destroyRecursive finding these:
	//dojo.forEach(node.getDescendants(), function(w){ w.destroy(); });
	node.destroyRecursive();
 }

It works.

comment:6 Changed 9 years ago by dante

Milestone: 1.51.6

comment:7 Changed 9 years ago by dante

Resolution: fixed
Status: assignedclosed

seems the "make destroy always recursive" ticket needs to happen. marking as fixed as per #10304 and knowing to call destroyRecursive() ... i use a custom function:

dijit.kill = function(widget){
     if(widget.destroyRecusrive){ widget.destroyRecursive(); }
     else if(widget.destroy){ widget.destroy(); }
};
Note: See TracTickets for help on using tickets.