Skip to main content

copy()

Description

Copies selected elements or elements specified by ids

note

The copy() method works only if the Diagram Editor is initialized in the default mode.

Usage

copy(ids?: (string | number)[]): void;

Parameters

  • ids - (optional) an array (list) of the elements' ids to copy

Example

  • call the method without arguments to copy elements from the selection list
const editor = new dhx.DiagramEditor("editor_container", { 
type: "default", // only default
});
// ...
editor.model.copy(); // copies selected items
  • pass some ids to the method to copy the corresponding elements
const editor = new dhx.DiagramEditor("editor_container", { 
type: "default", // only default
});
// ...
editor.model.copy(["1", "2"]); // copies the specified items

Change log: Added in v6.0