My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 51: Expand option not evaluated in JSON mode
1 person starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  moo...@wwwendt.de
Closed:  Nov 2008


 
Project Member Reported by moo...@wwwendt.de, Nov 1, 2008
(Reported by Julius Volz)
The current dynatree seems to only evaluate the 'expand' node option
when constructing a tree from an HTML tag list (not when loading from
AJAX/JSON).

The attached patch makes dynatree actually look at the data.expand value
when creating a new node and sets the bExpanded to true when
appropriate, which expands the node. I hope this is the right way to do
this - at least it works for me.

Patch
Index: src/jquery.dynatree.js
===================================================================
--- src/jquery.dynatree.js	(revision 64)
+++ src/jquery.dynatree.js	(working copy)
@@ -74,7 +74,11 @@
 		this.span = null; // not yet created
 		this.aChilds = null; // no subnodes yet
 		this.bRead = false; // Lazy content not yet read
-		this.bExpanded = false; // Collapsed by default
+		if (this.data.expand) {
+			this.bExpanded = true;
+		} else {
+			this.bExpanded = false; // Collapsed by default
+		}
 	},
 
 	toString: function() {
Nov 1, 2008
Project Member #1 moo...@wwwendt.de
Fixed with r65, r66
Status: Fixed
Jul 17, 2012
Project Member #2 moo...@wwwendt.de
considered verified
Status: Verified

Powered by Google Project Hosting