Skip to main content

getIndex()

Description

Returns the index of the item by its id

Usage

getIndex(id: string | number): number;

Parameters

  • id - (required) the id of the item

Returns

The method returns the index of the item

Example

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

const index = diagram.data.getIndex("1"); // -> returns 0