Skip to main content

getId()

gets the ID of an item

getId(index: number, parentId?: string): Id;

Parameters:

  • index: number - the index of the item
  • parentId: string - the id of the parent of an item

Returns:

The id of the item.

Example

const id = tree.data.getId(2, "1"); -> returns "3"