API reference: @salmonui/data-grid/engine/tree
TreeMethodstype
import type { TreeMethods } from '@salmonui/data-grid/engine/tree';type TreeMethods<Row> = {
getTreeRow(ctx: ModuleContext<Row>, rowId: RowId): TreeRowInfo | null;
getChildRows(ctx: ModuleContext<Row>, rowId: RowId | null): readonly Row[];
getChildRowIds(ctx: ModuleContext<Row>, rowId: RowId | null): readonly RowId[];
isExpanded(ctx: ModuleContext<Row>, rowId: RowId): boolean;
getLoadStatus(ctx: ModuleContext<Row>, rowId: RowId): TreeLoadStatus;
checkState(ctx: ModuleContext<Row>, rowId: RowId): TreeCheckState;
getChildSummary(ctx: ModuleContext<Row>, rowId: RowId): AggregateValues | null;
canIndent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean;
canOutdent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean;
getExpansion(ctx: ModuleContext<Row>): {
readonly expandedRows: Readonly<Record<RowId, boolean>>;
readonly defaultExpanded: boolean | number;
};
getInfo(ctx: ModuleContext<Row>): TreeInfo;
};
| Name | Signature | Description |
|---|---|---|
getTreeRow | getTreeRow(ctx: ModuleContext<Row>, rowId: RowId): TreeRowInfo | null; | Row info for the renderer and |
getChildRows | getChildRows(ctx: ModuleContext<Row>, rowId: RowId | null): readonly Row[]; | Kept children of a row in view order (null: the roots). |
getChildRowIds | getChildRowIds(ctx: ModuleContext<Row>, rowId: RowId | null): readonly RowId[]; | |
isExpanded | isExpanded(ctx: ModuleContext<Row>, rowId: RowId): boolean; | |
getLoadStatus | getLoadStatus(ctx: ModuleContext<Row>, rowId: RowId): TreeLoadStatus; | |
checkState | checkState(ctx: ModuleContext<Row>, rowId: RowId): TreeCheckState; | Checkbox tri-state derived from selected descendants ( |
getChildSummary | getChildSummary(ctx: ModuleContext<Row>, rowId: RowId): AggregateValues | null; | Child summary values of a parent (over its kept descendants), or null without aggregates. |
canIndent | canIndent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean; | Can |
canOutdent | canOutdent(ctx: ModuleContext<Row>, rowIds: readonly RowId[]): boolean; | |
getExpansion | getExpansion(ctx: ModuleContext<Row>): {
readonly expandedRows: Readonly<Record<RowId, boolean>>;
readonly defaultExpanded: boolean | number;
}; | Persistable expansion ( |
getInfo | getInfo(ctx: ModuleContext<Row>): TreeInfo; |