Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by David on Dec 04, 2008 06:56
open dhtmlx forum
How to get the position of a selected node

How do I get the current position of a selected node in the tree? I would like to pass this information out to a script but I can't figure out how.
Answer posted by Support on Dec 04, 2008 08:26
What do you mean by "position"?
You can get ID of parent item and index on level as

var id = tree.getSelectedItemId();
var pid = tree.getParentId(id);
var ind = tree.getIndexById(id);