Skip to main content

update()

Description

Updates properties of the item

note

The method can't be used to change the id or type of the item

Usage

update(
id: string | number,
newItem: object
): void;

Parameters

  • id - (required) the id of the item which needs to be updated
  • newItem - (required) a hash of properties which need to be updated

Example

const diagram = new dhx.Diagram("diagram_container", {
type: "default"
});
diagram.data.parse(data);

diagram.data.update(123, { text:"New text" });

Related articles: Updating an item