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

TreeView disregards Observable's inside ObservableArray passed as dataSource

2 Answers 41 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Danny Fritz
Top achievements
Rank 1
Danny Fritz asked on 23 Apr 2014, 10:38 PM
Is there a way to preserve the UID of ObservableObject's in an ObsrevableArray passed to a TreeView's dataSource?

I want to have a TreeView and ListView that share some observables. This way changing one would change the other too. It works if I pass the same ObservableArray in and bind ListView second, but I want them to have slightly different subsets.

I have a jsfiddle demonstrating the issue: http://jsfiddle.net/zNLNy/1187/

Thanks
Danny

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 24 Apr 2014, 09:16 AM
Hello Danny,

The object gets wrapped again because the TreeView uses kendo.data.Node as a base object model. Here is the updated sample that uses Nodes all around and does not update the uids.

Also, please note that if you are using TreeView templates and expect them to be updated when the observable objects change, you need to use .get("") methods so that the widget is aware which properties are being used. This has also been applied to the sample.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Danny Fritz
Top achievements
Rank 1
answered on 24 Apr 2014, 06:46 PM
Yep, changing to kendo.data.Node worked. Good to know template can detect changes too using get.

Thank you so much!
Tags
TreeView
Asked by
Danny Fritz
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Danny Fritz
Top achievements
Rank 1
Share this question
or