View as Markdown

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

TreeRowInfointerface

import type { TreeRowInfo } from '@salmonui/data-grid/engine/tree';
interface TreeRowInfo {
    readonly rowId: RowId;
    readonly depth: number;
    readonly parentId: RowId | null;
    readonly hasChildren: boolean;
    readonly childCount: number;
    readonly expanded: boolean;
    readonly loadStatus: TreeLoadStatus;
    readonly posinset: number;
    readonly setsize: number;
    readonly context: boolean;
    readonly visible: boolean;
}

What the renderer needs per tree row (ctx.tree, row ARIA, toggle). Stable identity while unchanged.

TreeRowInfo members (11)
NameSignatureDescription
rowIdreadonly rowId: RowId;
depthreadonly depth: number;
parentIdreadonly parentId: RowId | null;
hasChildrenreadonly hasChildren: boolean;

Kept children, or unloaded lazy children (hasChildrenField).

childCountreadonly childCount: number;
expandedreadonly expanded: boolean;

Shown expanded: false for a lazy parent whose children were never requested, whatever its default (isExpanded reads the state).

loadStatusreadonly loadStatus: TreeLoadStatus;
posinsetreadonly posinset: number;

1-based ordinal and count among kept siblings (aria-posinset / aria-setsize).

setsizereadonly setsize: number;
contextreadonly context: boolean;

Kept only as an ancestor or descendant of a match (data-tree-context).

visiblereadonly visible: boolean;

Visible in the current view (not hidden by a collapsed ancestor, a filter, or the page).