How to navigate tree nodes


#1

How can I get the parent node or children nodes, according to the currend particular node in the tree? I cannot find the api, which is frequently used in Dhx5.x.
Thanks


#2

Use methods of TreeCollection API.

For id of parent node:
let parentId = tree.data.getParent('currentItemId');

For object of parent node:
let parentObject = tree.data.getItem(tree.data.getParent('currentItemId'));

For array of children nodes:
let children = tree.data.getItems('currentItemId');


#3

Thank you for your quick reply. I find it along your instruction.
I missed the Helpers section, it’s my fault.