Skip to main content

validation()

Description

Validates cells of the swimlane by the direction and action type

Usage

validation(
cellIndex: number,
dir: string, // "up" | "down" | "left" | "right"
action: string // "move" | "remove" | "add"
): boolean;

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"
  • action - (required) the type of the action: "move" | "remove" | "add"

Returns

The method returns true if the cell is validated, otherwise false

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");

// validates if the cell with index 0 can be moved down
diagram.cellManager.validation(0, "down", "move"); // -> true

Change log: Added in v4.0

Related articles: Configuring Swimlanes