Skip to main content

eachParent()

Description

Iterates through all parents of the specified item

Usage

eachParent(
id: string | number,
callback: function,
self?: boolean
): void

Parameters

  • id - (required) the id of the item
  • callback - (required) a callback function that will be applied to each parent of the item
  • self - (optional) defines whether the callback function should iterate over the specified item itself; false by default

Example

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

diagram.data.eachParent("id_1.1.1", (item) => {
console.log(item);
}, false);

Change log: Added in v4.0