validation

validates cells of the swimlane by the direction and action type

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

Parameters

cellIndexnumberthe start index of a cell in a layout
dir"up"|"down"|"left"|"right"the direction of the action
action"move"|"remove"|"add"the type of the action

Returns

booleantrue 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

Details

The count of the index starts from 0.

See also
Change log

Added in v4.0

Back to top