@spartanfx/react v1.2.2
@spartanfx/react / index / ITreeViewSchema
Interface: ITreeViewSchema<T>
Schema configuration for mapping item fields to tree structure.
Supports both flat (id/parentId) and nested (children) data structures.
Type Parameters
T = any
Properties
| Property | Type | Description |
|---|
childrenField? | string | keyof T | Field name for nested children array. If provided, expects nested structure |
idField? | string | keyof T | Field name for the unique identifier. Defaults to 'id' |
labelField? | string | keyof T | Field name for the display label. Defaults to 'label' |
parentIdField? | string | keyof T | Field name for the parent ID. Defaults to 'parentId' |
pathField? | string | keyof T | Field name for a path string that encodes the hierarchy (e.g. "/Docs/Reports/Q1.pdf"). When set, the tree is built from path segments instead of parentId: each item nests under the item at its parent directory, and any missing intermediate folders are synthesized as nodes. Use this for document-library style data that has no parent/child lookup. Ignored when childrenField (nested mode) is provided. |