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:
The code would look something as follows:
treeView = $(
dataItem = treeView.dataSource.getByUid(
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.
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.