So I have done my initial loading of the TreeList with datasource read. During that time I cache off the DataSourceTransportOptions passed into the read method
This tree shows fine initially but I am trying to then load a subtree with many nodes under a user selected node. I download the partial subtree of data and have the id's and parentId's set properly and use the cached DataSourceTransportOptions to call options.success(myCompleteList). My expectation is that my data would be inserted into the correct location but it appears to screw up the id's and parentId's of the rendered data.
I have confirmed that the id's and parent id's of my data is correct just that the view is not.
Obviously, I am doing something wrong or perhaps it is a limitation that I cannot build up a tree a subtree at a time.
-Craig
5 Answers, 1 is accepted
I was not able to reproduce the described issue on my end.
Still, in this scenario, I can suggest using the data method of the dataSource to retrieve the current tree data, then add the new tree to it and set the new data using again the data method:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-data
I made a Dojo example demonstrating this implementation:
http://dojo.telerik.com/IsEzI
I hope this is helpful.
Regards,
Stefan
Telerik by Progress
Hi Stefan,
The suggestion to add it directly to the datasource.data() seemed to do the trick. We have used the technique of reusing the options.success() after the initial load with other controls but the this control seemed to not like this.
Thanks
Craig
Hello Stefan,
In your dojo example:
http://dojo.telerik.com/IsEzI
If the data objects rename the attributes "id" for "att_id" and "parentId" for "att_parentId" and consider such changes for the model in the TreeDataSource :
model: {
id: "att_id",
fields : {
parentId : { field: "att_parentId", nullable: true }
}
}
When the names are different this is expected because the data method will not use the schema.model configuration to parse the set data items.
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-data
"The schema.model configuration will not be used to parse the set data items. The data should be parsed in advance and the values should be provided in the correct type - date values should be JavaScript Date objects, numeric values should be JavaScript numbers, and others."
In this case, the new objects have to have a parentId instead of some_name_parentId.
Regards,
Stefan
Progress Telerik
Hello Stefan,
Excellent! ... Thanks a lot for the clarification.
Regards.