getRoot

returns the id of the root item by the id of its child

string getRoot(string|number id);

Parameters

idstring|numberthe id of the child item

Returns

stringthe id of the root item

Example

diagram.data.getRoot("id_1.1.1"); -> "id_1"

Details

The root item is the first item of a tree structure.

See also
Change log

Added in v4.0

Back to top