| Issue 44: | Tree doesn't seem to process children recursively | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Initialize the tree by running the attached script. What is the expected output? What do you see instead? I'd expect the tree to be populated with all children. Instead, the tree contains data only until the "Department" level (e.g. the nodes with "John Doe", "Joe Sixpack" and so on are not in the tree). What version of the product are you using? dynatree-0.3_beta_20080914 On what operating system and browser? Windows, Firefox 2, IE 7, IE6, Opera 9.27 and Safari 3.1.2.
Oct 20, 2008
Hi, I fixed this lately (see issue #41 , r60), it's in the trunk but not in a new release yet. Thank you anyway.
Status:
Duplicate
Jan 26, 2013
(No comment was entered for this change.)
Labels:
Milestone-Release0.0
|
I possibly found the bug in the code. In the initialization section, we can see the following code: // Init tree structure if( opts.children ) { // Read structure from node array root.append(opts.children); [...] Which I interpret as "pass the list of children to the "Append" method. However, when each node is processed, code is as follows: [...] if( data.children ) for(var j=0; j<data.children.length; j++) dtnode.append(data.children[j]); [...] Which I read as "passing each single child to the Append method". I believe this approach is wrong (it should be recursive), so I changed the code as follows; [...] if( data.children ) dtnode.append(data.children); [...] Now everything seems to be working, but I'd like to wait for a confirmation before bringing the code to production. Thanks.