Skip to main content

add()

info

The add() method is automatically validated by the system. The cell won't be added if it is not possible according to the structure of the swimlane.

Description

Adds cells as rows or columns to a swimlane

Usage

add(
cellIndex: number,
dir: string // "up" | "down" | "left" | "right"
): void;

Parameters

  • cellIndex - (required) the start index of a cell in a layout. The count of the index starts from 0
  • dir - (required) the direction of the action: "up" | "down" | "left" | "right"

Example

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

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

diagram.cellManager.add(0, "down"); // adds cells as rows

Change log: Added in v4.0

Related articles: Configuring Swimlanes