Skip to main content

getRoot()

Description

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

Usage

getRoot(id: string | number): string | number;

Parameters

  • id - (required) the id of the child item

Returns

The method returns the id of the root item. The root item is the first item of a tree structure

Example

const diagram = new dhx.Diagram("diagram_container", {
type: "default"
});
diagram.data.parse(data);

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

Change log: Added in v4.0