Skip to main content

eachChild()

Description

Iterates through the children of the specified item

Usage

eachChild(
id: string | number,
callback: function,
isTree?: boolean
): void;

Parameters

  • id - (required) the id of the item
  • callback - (required) a callback function that will be applied to each child of the item
  • isTree - (optional) defines, whether the function should iterate through all children (of any level) of the specified item. If false, the function will iterate only through the first-level children of the item; true by default.

Example

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

diagram.data.eachChild("id_1", (item) => {
console.log(item);
}, true);

Change log: Added in v4.0