Title: Tree grid - loading expanded node data with loader property Post by: amir-t on July 14, 2013, 10:10:48 AM Hi,
im tyring to implement a dynamic load, without using any url, but to make a custom loader which gets the data from web service. when i load the root level data, the loading is as expected, but when expending one of the root parents, then the children data is overring the existed root level and not appended to the expanded parent (as its children data), but just replacing the all treeGrid data. It's important to mention' that i've checked that the children data of the expanded node are as expected, and that all the chidrens holds the correct 'parentId' property, which points to the expanded node that was pressed. Code: $('#treeDiv').treegrid({ Example of the data: root level: Code: [{id: 1, children data of the expanded parent: Code: [{id: 11, Title: Re: Tree grid - loading expanded node data with loader property Post by: stworthy on July 14, 2013, 07:48:50 PM If you would like to expand a node to retrieve its children nodes, the node's state should be set to 'closed'. Please add 'state' property to the root node.
Code: [{id: 1, Title: Re: Tree grid - loading expanded node data with loader property Post by: amir-t on July 15, 2013, 01:04:08 AM Hi,
i tried your advice, but still doesn't work :( when i set the state property for some parent node as follows: Code: [{id: 1, Still on the loader callback, after expanding the parent, this following code line still replaces all the tree's data instead of appending it to the expanded parent: success(data); please notice the comments in this code block (the loader function scope): Code: $('#treeDiv').treegrid({ Title: Re: Tree grid - loading expanded node data with loader property Post by: stworthy on July 15, 2013, 01:22:45 AM Please refer to this example http://jsfiddle.net/dvAcu/.
Title: Re: Tree grid - loading expanded node data with loader property Post by: amir-t on July 15, 2013, 03:55:05 AM Works fine now.
thanks ! :) |