#5062 closed enhancement (fixed)
Tree: method to fully expand a tree (expand all nodes in the tree recursively)
Reported by: | jgarfield | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.0 |
Keywords: | dijit, tree, dijit.Tree | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
I've been seeing a lot of questions in regards to 'dynamically or auto expanding a Tree'. You can do such using a forEach on the TreeNodes? and calling _expandNode(), however, that's marked as a private method, which makes this practice not-so-good.
Should we add a public property or function to allow for this?
Example property would be something like autoExpand="true"
Example function would be something like expandNode: function(node) { }
Any takers?
Attachments (1)
Change History (13)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Milestone: | 1.1 → 2.0 |
---|
Changed 12 years ago by
Attachment: | dijit.Tree.expandChildren.patch added |
---|
comment:4 Changed 12 years ago by
Find attached a patch to dijit.Tree that exposes an expandChildren() method. It will expand a node and all of its children.
Example: var myTree = new dijit.Tree(...); myTree.expandChildren();
comment:5 Changed 12 years ago by
comment:6 Changed 12 years ago by
Owner: | set to bill |
---|---|
Summary: | dijit.Tree Auto-Expand functionality → Tree: method to fully expand a node (and all it's descendants) |
(Above check in comment was actually for another ticket, put here by mistake.)
Not sure if this method is worth putting into Tree; I am trying to keep the API surface small.
BTW I don't think that patch works in the general case because it doesn't account for async-loading of tree nodes.
comment:7 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.3 → future |
comment:8 Changed 10 years ago by
Summary: | Tree: method to fully expand a node (and all it's descendants) → Tree: method to fully expand a tree (expand all nodes in the tree recursively) |
---|
comment:9 Changed 10 years ago by
In addition to async-loading of tree nodes patch limit I think that "expand all" concept fail flat when tree is infinite deep because of an item being a descendant of self.
comment:10 Changed 10 years ago by
Milestone: | future → 1.4 |
---|---|
Status: | new → assigned |
comment:11 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:12 Changed 10 years ago by
(In [20529]) Replace expandAll() method with autoExpand=true flag specified on initialization. Could have an expandAll() method too (and I guess collapseAll() method) but I'm not sure there's a need; seems like something developers would just want to do when a Tree is first displayed. Refs #5062 !strict.
I'm not sure what you mean. If there's an expandNode() method than that's for programatically expanding a tree node. What do you mean by "auto-expand"? And what would the autoExpand="true" property do? Expand every node in the tree?