ITreeNode Interface
The runtime representation of a single tree node as managed by client-side tree providers. This is the object your components receive via pageData when using a client-side tree provider.
Client-side tree providers (e.g. CTreeClientDataProvider) build and maintain ITreeNode objects internally. You interact with them via component callbacks.
import type { ITreeNode } from '@katlux/providers'
// Example: reading node state in a custom tree template
const handleNodeClick = (node: ITreeNode) => {
console.log(node.id) // unique identifier
console.log(node.parentId) // null for root nodes
console.log(node.depth) // 0 = root, 1 = child, ...
console.log(node.hasChildren) // whether the node can be expanded
console.log(node.isExpanded) // current expansion state
console.log(node.data) // the raw row object from your data
}| Property | Type | Description |
|---|
| id | string | number | The unique identifier for the node, derived from the row's idKey field. |
| parentId | string | number | null | The parent node's ID. null for root nodes. |
| depth | number | Nesting depth. 0 = root, 1 = direct children, and so on. |
| hasChildren | boolean | Whether this node has any children (expanded or not). |
| isExpanded | boolean | Current expansion state. Toggled by user interaction or toggleNode(). |
| data | TDataRow | The original raw row object from your data source. |