createDataTree

Creates a tree from the passed dataset.

Parameters

dataset

any[]

The source dataset of data items.

getId

(item: any) => any

A function which will return the id of the data item.

getParentId

(item: any) => any

A function which will return the data item id of its parent data item.

subItemsField

string

The field which points to the subitems collection of each data item.

Returns

any[]

  • A collection of the generated data items that are structured in a tree.