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:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/getbyuid
The code would look something as follows:
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.
https://docs.telerik.com/kendo-ui/api/javascript/ui/treeview/methods/append
https://docs.telerik.com/kendo-ui/api/javascript/ui/treeview/methods/remove
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.