flatTree() function
Converts a tree structure into a flat array.
Signature:
typescript
export declare function flatTree(treeList: any[], options?: IFieldOptions): any[];Parameters
Parameter | Type | Description |
|---|---|---|
treeList | any[] | Tree structure array |
options | (Optional) Customizes id field name, child element field name, parent element field name. Default: { keyField: 'key', childField: 'children', pidField: 'pid' } |
Returns:
any[]
{any[]} Flat array