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

TreeView checkbox selection lost on node expand

2 Answers 156 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Piyush
Top achievements
Rank 1
Piyush asked on 22 Dec 2016, 10:37 AM

We are using TreeView which is configured as "loadOnDemand: true" and have checkbox nodes.

In our use case, we need to progmatically select (ticking) matching nodes (which may be present deep inside the hierarchy).

When we try to expand the node, having progmatically ticked nodes which have not loaded earlier, the checkbox selection is getting lost.

http://dojo.telerik.com/@ksingh269/EtaQE

In the above example, on selection of node "Kendo UI Project", another node "Reports>February.pdf" is progmatically ticked. Now when we try to expand node "Reports", the selection is lost.

We are upgrading version from 2015.1 318 to 2016.3.1118 and our project gone through regression cycle. Won;t be possible to move to new build.

Please suggest work around.

I appears to have lost behavior at 2015.3.1111.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 22 Dec 2016, 02:14 PM

Hello Piyush,

The problem appears to be in the expectation that the fetching of subnodes happens synchronously. The dataSource fetch() is not guaranteed to happen so (especially in the future, with jQuery 3). A cleaner approach is to call the Node.load method to load the subnodes, and use its promise to iterate subnodes. See this Dojo snippet.

Regards,
Alex Gyoshev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Piyush
Top achievements
Rank 1
answered on 23 Dec 2016, 05:34 AM

Hi Alex,

This make sense. After changing the approach, it works.

Many Thanks :)

Regards,

Piyush

Tags
TreeView
Asked by
Piyush
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Piyush
Top achievements
Rank 1
Share this question
or