getId()
gets the ID of an item
getId(index: number, parentId?: string | number): string | number;
Parameters:
index: number
- the index of the itemparentId: string | number
- the id of the parent of an item
Returns:
The id of the item.
Example
const id = tree.data.getId(2, "1"); -> returns "3"