API reference: @salmonui/data-grid/engine/tree
TreeStructureinterface
import type { TreeStructure } from '@salmonui/data-grid/engine/tree';interface TreeStructure {
readonly index: TreeLayout;
readonly layout: TreeLayout;
readonly sourceIds: readonly RowId[];
sourceIndexOf(rowId: RowId): number;
readonly parentIdField: string | null;
readonly nested?: boolean;
withParent(row: unknown, parentId: RowId | null): unknown;
}
Tree reads the selection, editing, and row drag modules use through
treeOf(model) (view-helpers.ts) without importing tree code: the full
(unfiltered) tree and the kept layout of the current query.
| Name | Signature | Description |
|---|---|---|
index | readonly index: TreeLayout; | Every source row (unfiltered, source sibling order). |
layout | readonly layout: TreeLayout; | Rows kept by the current query, in sorted sibling order. |
sourceIds | readonly sourceIds: readonly RowId[]; | |
sourceIndexOf | sourceIndexOf(rowId: RowId): number; | Source index of a row id, or -1. |
parentIdField | readonly parentIdField: string | null; |
|
nestedoptional | readonly nested?: boolean; | Parents come from the nesting ( |
withParent | withParent(row: unknown, parentId: RowId | null): unknown; | Returns a copy of |