| Issue 225: | Proposed new feature: hide siblings | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I'd like to suggest some additional functionality: when a node is expanded, the siblings of the expanded node are hidden. Closing an expanded node should unhide its siblings. This makes it easier to focus on only the path down to the most-expanded nodes, which is particularly helpful when there is a large number of children for some (most?) of the nodes. The following patch against $Revision 520 works for me(tm), but the default for autoHide should probably be false: --- jquery.dynatree.js~ 2011-08-16 09:23:24.000000000 +0200 +++ jquery.dynatree.js 2011-08-25 08:58:02.988172500 +0200 @@ -1056,6 +1056,17 @@ parents[i].collapseSiblings(); } } + // new code: + if( this.parent && opts.autoHide ) { + var display = this.bExpanded ? "none" : ""; + for (var i=0; i<this.parent.childList.length; i++) { + var child = this.parent.childList[i]; + if (child !== this) { + child.li.style.display = display; + } + } + } + // end // If the currently active node is now hidden, deactivate it if( opts.activeVisible && this.tree.activeNode && ! this.tree.activeNode.isVisible() ) { this.tree.activeNode.deactivate(); @@ -2996,6 +3007,7 @@ keyboard: true, // Support keyboard navigation. persist: false, // Persist expand-status to a cookie autoCollapse: false, // Automatically collapse all siblings, when a node is expanded. + autoHide: true, // Automatically hide all siblings when a node is expanded clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand activeVisible: true, // Make sure, active nodes are visible (expanded). checkbox: false, // Show checkboxes.
Nov 15, 2012
Thank you very much. That functionality is what I was looking for.
Feb 10, 2013
(No comment was entered for this change.)
Labels:
-Milestone-Release1.3 Milestone-Release2.0
Oct 6, 2013
(No comment was entered for this change.)
Owner:
---
May 1, 2014
As of 2014 Dynatree is feature frozen. Please have a look at Fancytree (sequel of DynaTree 1.x): chances are good that the problem was resolved / the requested featuer is already implemented. Please open a new issue there otherwise: https://github.com/mar10/fancytree
Status:
WontFix
|
Owner: moo...@wwwendt.de
Labels: Milestone-Release1.3