Opened 12 years ago

Closed 12 years ago

#4936 closed defect (invalid)

dijit.Tree expando will not update if a node loses its children

Reported by: tk Owned by: tk
Priority: high Milestone: 1.1
Component: Dijit Version: 0.9
Keywords: dijit Tree Cc: bill
Blocked By: Blocking:

Description

If you call destroyDescendants() on a TreeNode? its expando (+/-) will never update...

(this is the bug that Chris Barber found with Dojo Module back when he ported to 0.9 but was never posted)

I'm working on finding a good solution to this ASAP.

Attachments (1)

dijit-tree-bug-4936.patch (1.0 KB) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by guest

Attachment: dijit-tree-bug-4936.patch added

comment:1 Changed 12 years ago by guest

This bug is caused when a child item is replaced by zero or more new child items during the expand operation (i.e. when tree nodes are lazy loaded). The fix is to re-populate the childItems array before the expand completes so that it can render the new children.

comment:2 Changed 12 years ago by tk

Cc: bill added
Milestone: 1.0
Priority: normalhigh
Status: newassigned

comment:3 Changed 12 years ago by bill

Milestone: 1.01.1

This change looks dangerous and we don't often call destroyDescendants() on a tree node (I have no idea why Chris is doing it), so let's defer to 1.1.

comment:4 Changed 12 years ago by tk

as is lazy loading datastores won't work with tree... Unless you can show the correct way of doing that... Chris should be finding you online to discuss

comment:5 Changed 12 years ago by bill

Resolution: invalid
Status: assignedclosed

OK, talked to CB1 about this for a while. His store was doing something weird, essentially lying about the number of children of an item, claiming it had one child until you loaded the child in which case the number of children changed to 0 or 10, etc.

Suggested store be changed so that

  1. hasAttribute(item, "children") always returns true (regardless of how many children there are, even if there are 0 children)
  2. getValues(item, "children") returns an array of children, possibly a 0-length array
Note: See TracTickets for help on using tickets.