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

urgent. problem restoring kendo treeview state

1 Answer 29 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 26 Jul 2016, 01:10 AM
Hello I'm trying to load a load-on-demand treeview on document.ready and trigger the select event of a child node according to a path like shows this jsbin:
http://jsbin.com/ESOjAmi/8/edit?html,css,output
The problem in my case is that exist child nodes that have the same id as parents, because are two different entities, so in those cases the parent is expanded but the children that I want to select and trigger the select event is not selected I guess because the method get in the datasource returns the first node that match the id.
The problem is in this part of the code in the jsbin example because in the case of the path [1,1] for example it expands the parent node but not the children with id 1 and i want to trigger the select event of the children node. In the other cases for example with path [1,2] the treeview is expanded and the select event of the child node with id = 2 is triggered correctly
 else {
        // otherwise select
        node = treeview.findByUid(ds.get(path[0]).uid);
        treeview.select(node);
        treeview.trigger("select", { node: node });
      }
Maybe someone can modify the JSbin example to reflect my case please?
Thank you

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 27 Jul 2016, 02:05 PM
Hi Luis,

The discussed, and all other Kendo UI widget methods, expecting a data item ID as a parameter, work on the presumption that all IDs are unique. The data items must have a field that is unique for all different items (normally this is the ID).

Regards,
Dimiter Topalov
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
TreeView
Asked by
Luis
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or