This is a migrated thread and some comments may be shown as answers.

AngularJS TreeView not updated

2 Answers 155 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Passport
Top achievements
Rank 1
Passport asked on 25 Feb 2015, 10:43 AM
We are using KendoUI TreeView with AngularJS.

DataSource attached to TreeView via k-data-source attribute.
If DataSource initialized via ajax request - TreeView not updated and still empty.

Example of such behavior: http://dojo.telerik.com/iGAbu

2 Answers, 1 is accepted

Sort by
0
Accepted
Petyo
Telerik team
answered on 27 Feb 2015, 07:16 AM
Hi Artem,

when the treeview is instantiated with a plain object as a datasource, it treats it as configuration options and instantiates a datasource instance from it. Subsequent updates of the object are not taken into account. To work around that, you may use k-ng-delay - please check an updated version of your example. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Wray
Top achievements
Rank 1
answered on 03 Mar 2015, 02:30 PM
Works for me, if after receiving the delayed datasource, I do following:

         var ds = new kendo.data.HierarchicalDataSource(
                {
                    data: myHierarchyData
                });

                $scope.treeWidget.setDataSource(ds);
Tags
TreeView
Asked by
Passport
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Wray
Top achievements
Rank 1
Share this question
or