View as Markdown

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

RemoteTreeEnvelopeinterface

import type { RemoteTreeEnvelope } from '@salmonui/data-grid/engine/tree-remote';
interface RemoteTreeEnvelope<Row> {
    readonly kind: 'tree';
    readonly row: Row;
    readonly parentId?: RowId | null;
    readonly depth?: number;
    readonly hasChildren?: boolean;
    readonly childCount?: number;
    readonly children?: readonly RemoteTreeEnvelope<Row>[];
}

A tree read item (structural copy of @salmonui/data TreeRowEnvelope; depth is informational).

RemoteTreeEnvelope members (7)
NameSignatureDescription
kindreadonly kind: 'tree';
rowreadonly row: Row;
parentIdoptionalreadonly parentId?: RowId | null;

Parent of the row (null: a root). Default: the requested parent, or the envelope holding it in children.

depthoptionalreadonly depth?: number;
hasChildrenoptionalreadonly hasChildren?: boolean;
childCountoptionalreadonly childCount?: number;
childrenoptionalreadonly children?: readonly RemoteTreeEnvelope<Row>[];

Children loaded with the row (load all, nested remote data); [] means a leaf.