View as Markdown

API reference: @salmonui/data-grid/engine

RowModelSnapshotinterface

import type { RowModelSnapshot } from '@salmonui/data-grid/engine';
interface RowModelSnapshot<Row> {
    readonly source: readonly Row[];
    readonly sourceIds: readonly RowId[];
    readonly order: Int32Array | null;
    readonly count: number;
    readonly groups?: GroupTreeSnapshot | null;
    readonly aggregates?: AggregateModelSnapshot | null;
    readonly view?: RowModelView | null;
    readonly pinned?: Int32Array | null;
}

Visible row model. Rows are stored by reference in source with parallel sourceIds; order maps a visible index to a source index (null means the identity order). No per-row wrapper objects exist.

RowModelSnapshot members (8)
NameSignatureDescription
sourcereadonly source: readonly Row[];
sourceIdsreadonly sourceIds: readonly RowId[];
orderreadonly order: Int32Array | null;

Data rows in view order (source indexes). With a view, the data order the view windows into.

countreadonly count: number;

Visible rows: order.length, or view.count when a view mixes in synthetic rows.

groupsoptionalreadonly groups?: GroupTreeSnapshot | null;

Group structure from the group stage (grouping module).

aggregatesoptionalreadonly aggregates?: AggregateModelSnapshot | null;

Aggregate results from the aggregate stage (aggregates module).

viewoptionalreadonly view?: RowModelView | null;

Visible row model mixing synthetic rows (group captions and footers) with data rows, addressed by visible index without a materialized list. When present, count === view.count and index lookups go through the view.

pinnedoptionalreadonly pinned?: Int32Array | null;

Pinned rows: source indexes of the rows at visible indexes [0, pinned.length), in sort order. They are outside the page window, the groups, and the detail rows. Absent when no row is pinned.