Static buildAppends the child rows of data (recursively) to parent – used by buildTreeRows.
No row deeper than deepMaxLimit is created: the children of a row at depth deepMaxLimit are
skipped with a console warning.
the object whose children are added
name of the children property (default "children")
the tree row of data (default: a new, expanded top-level row)
depth of parent (0 = top level)
maximum depth of a created row (default 12)
expanded state of the new rows (default true)
parent
const root = TreeFactory.buildTreeRow<OrderNode>(nodes[0], "children");
console.log(root.children?.length);
Static buildBuilds tree rows (input for TableFactory.createTableModel({ rows })) from nested objects.
the top-level objects
name of the children property (default "children") or TreeFactoryOptions
maximum depth of a row, 0 = top level only (default 12; ignored when options are passed)
expanded state of the rows (default true; ignored when options are passed)
const rows = TreeFactory.buildTreeRows<OrderNode>(data, { childrenProperty: "children", expanded: false });
Turns hierarchical data into tree rows for a tree table. Pass the result as
rowsto TableFactory.createTableModel – the factory then creates an AreaModelTree; the first column shows the arrows.Example
See
Training: Tree table with checkboxes