eachChild

iterates through the children of the specified item

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

Parameters

idstring| numberthe id of the item
callbackfunctionthe function that will be applied to each child of the item
isTreebooleanoptional, 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

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

See also
Change log

Added in v4.0

Back to top