| Page 1 of 1 | [ 3 posts ] |
|
Hi,
I have a TreeView that I create by passing in JSON, along the lines of the static definition in this example: http://developer.yahoo.com/yui/examples ... arkup.html The tree displays and works properly, yet every node has isLeaf set to false...including the leaves. Is there something I'm overlooking to get this to work right? Since the constructor created the tree (as opposed to me doing it node by node) I figured it would set the isLeaf property correctly. Do I need to do it manually? Thanks, Paul |
|
The isLeaf property is meant only for dynamic trees, not for static ones, where it is meaningless. In dynamically loaded trees, TreeView assumes that all nodes can be expanded and adds a plus sign to every node, assuming that it can be expanded into more nodes. Since the child nodes are to be loaded dynamically at some point, it is the most useful guess since it allows the visitor to keep diving into the branches and, at any rate, as part of the dynamic loading, the server might report that there are no further children that way.
However, when the child nodes are dynamically loaded, you can signal TreeView that a node is a leaf so no plus sign is placed in front of it and precluding any further diving into it. Thus, isLeaf might be considered a write-only property to signal that a dynamically loaded node will have no children, it does not report on statically loaded nodes. To find out about statically loaded nodes, check the length of the array of its children. |
|
Thanks...for another great answer!
Paul |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group