This is a migrated thread and some comments may be shown as answers.
KendoUI Treeview with AngularJS uncheck checkboxes
1 Answer 60 Views
This is a migrated thread and some comments may be shown as answers.
Pieter-Jan
Top achievements
Rank 1
Pieter-Jan asked on 10 Apr 2015, 08:16 AM

I'm using KendoUI (v2015.1.318) with AngularJS (v1.3.14). After every click on a node, the data will be fetched from an API. 
After selecting some items and clicking on the button "add", the items will be added in a seperated list, the expanded treenodes must stay visible but all the 
checked items must be unchecked. 

After I iterated through the datasource to uncheck the checked items , I have call SetDataSource again. When I have expanded a lot of nodes and checked a few, the UI freezes some seconds while it's processing.

I was wondering if there wasn't a more efficient way to execute this.

I made an example without API call: 

Plunker example

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 13 Apr 2015, 10:50 AM

Hello Pieter-Jan,

Yes, you can call the dataItem set("checked", false) method to notify the model of the field change, and the TreeView will update automatically (this is the way the Kendo UI MVVM model works, which is a bit different than the AngularJS direct assignment). See the updated plunker here. Note that accessing the internal DataSource field _data is not supported, so I've updated the code to use the data() method.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Asked by
Pieter-Jan
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or