View as Markdown

API reference: @salmonui/data-grid/engine/tree

TreeStateinterface

import type { TreeState } from '@salmonui/data-grid/engine/tree';
interface TreeState {
    readonly childrenField: string | null;
    readonly parentIdField: string | null;
    readonly hasChildrenField: string | null;
    readonly expandedField: string | null;
    readonly column: string | null;
    readonly defaultExpanded: boolean | number;
    readonly useField: boolean;
    readonly expanded: Readonly<Record<RowId, boolean>>;
    readonly filterMode: TreeFilterMode;
    readonly pageBy: TreePageBy;
    readonly checkbox: boolean;
    readonly cascade: TreeCascade;
    readonly copyMode: TreeFilterMode;
    readonly childSummary: boolean;
    readonly loadVersion: number;
}
TreeState members (15)
NameSignatureDescription
childrenFieldreadonly childrenField: string | null;
parentIdFieldreadonly parentIdField: string | null;
hasChildrenFieldreadonly hasChildrenField: string | null;
expandedFieldreadonly expandedField: string | null;
columnreadonly column: string | null;
defaultExpandedreadonly defaultExpanded: boolean | number;
useFieldreadonly useField: boolean;

expandedField still applies (cleared by expand all, collapse all and an explicit default).

expandedreadonly expanded: Readonly<Record<RowId, boolean>>;

Row id -> expanded, overriding the per-row default (only values that differ from it).

filterModereadonly filterMode: TreeFilterMode;
pageByreadonly pageBy: TreePageBy;
checkboxreadonly checkbox: boolean;
cascadereadonly cascade: TreeCascade;
copyModereadonly copyMode: TreeFilterMode;
childSummaryreadonly childSummary: boolean;
loadVersionreadonly loadVersion: number;

Bumped when a child load or a parent override (tree.setParents) changes the tree.