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

Select node on specific path

2 Answers 132 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Siarhei
Top achievements
Rank 1
Siarhei asked on 06 Oct 2015, 01:47 PM

Hello,

Lets say we have 2 different paths in treeview and on child level of these paths we have the same elements (bar)

$("#treeview").kendoTreeView({
  loadOnDemand: true,
  dataSource: [
    { text: "foo", expanded: true, items: [
      { text: "bar" }
    ] },
    { text: "ttt", expanded: true, items: [
      { text: "bar" }
    ] }
  ]
});

 

How can i select 'bar' node from the second path ('ttt' node)?

There is expandPath method to expand tree that accepts array of ids to expand. I want to achieve the same but for selection.

 http://dojo.telerik.com/IFamO/4

There i want to select 'bar' under 'ttt' node (programmatically).

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 08 Oct 2015, 08:08 AM
Hello Siarhei,

You can add ids to the items and select the node using its unique id. The approach is illustrated below:



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Siarhei
Top achievements
Rank 1
answered on 12 Oct 2015, 02:53 PM

Thanks a lot.

It helped!!!

Tags
TreeView
Asked by
Siarhei
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Siarhei
Top achievements
Rank 1
Share this question
or