moveTreeItem

Moves the targeted item in the tree to another position.

Parameters

data any[]

The data tree.

target number[]

The level of the target tree item which will be moved.

destination number[] | null

The level of the destination tree item where the target item will be moved in. If it is null, the target item will be added at the root level.

subItemsField string

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

Returns

any[] - The new data tree.