Skip to main content

getCellIndex()

Description​

Returns the index of the cell of the swimlane by the id

Usage​

getCellIndex(
cellId: string | number,
type: string // "row" | "col"
): number | undefined;

Parameters​

  • cellId - (required) the id of a cell
  • type - (required) the type of direction to count the index: "row" | "col"

Returns​

The method returns the index of the cell. The count of the index starts from 0

Example​

// initialization of the diagram
const diagram = new dhx.Diagram("diagram_container", {
// config options
});
diagram.data.parse(data);

// sets active swimlane
diagram.cellManager.setSwimlane("main");

// gets the index of the cell
diagram.cellManager.getCellIndex("r01", "row"); // -> 0

Change log: Added in v4.0

Related article: Configuring Swimlanes