i'm initializing a treeview control which has the hasChildren property set on the model as a function and a remote based datasource.
is there any way to force a re-evaluation of the hasChildren function on a given node without re-reading from the remote server?
1 Answer, 1 is accepted
0
Joana
Telerik team
answered on 28 Nov 2018, 04:02 PM
Hi Greg,
You could get the dataItem and directly access its hasChildren property. So, you could find the TreeView dataItem via the getByUid method of the dataSource:
var treeView = $("#treeview").data("kendoTreeView");
var dataItem = treeView.dataSource.getByUid("3f88bc92-72c4-4f6e-8635-0f0e2bdb0606")
console.log(dataItem.hasChildren)
However, for removing and adding nodes to use the append method of the treeview and the remove method of the TreeView. Even if you could set the hasChildren field to new value, the already rendered node will not be updated, and thus, unexpected behavior might occur.
If you need further assistance, you might share more details on the use case you are implementing and a sample project of the achieved.
Regards,
Joana
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.