Skip to main content

add

selects the specified item

add(id: Id, subId?: Id): void;

Parameters:

  • id: string | number - the item id
  • subId: string | number - optional, the id of a subheader of a swimlane or a text element of a line

Example

// diagram must be created with the "select:true" option
const diagram = new dhx.Diagram("diagram_container", {
select: true
});
diagram.data.parse(data);

diagram.selection.add("2");