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

Get node index

1 Answer 362 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kris
Top achievements
Rank 1
Kris asked on 30 Jul 2014, 11:15 AM
How to get the index for a given node within its parent node?

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 01 Aug 2014, 06:15 AM
Hi Kris,

Similar behavior could be achieved by checking the index property of the dataItem corresponding to the <li> item. For example: 
//Get the index of the currently selected node:
var index = treeView.dataItem(treeView.select()).index;

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
Kris
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or