Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / ClientRowModel

Class: ClientRowModel<TRow>

Defined in: datagrid-core/dist/index.d.ts:5910

Type Parameters

TRow

TRow = GridRowData

Implements

  • RowModel<TRow>

Constructors

Constructor

new ClientRowModel<TRow>(rows, options): ClientRowModel<TRow>

Defined in: datagrid-core/dist/index.d.ts:5916

Parameters

rows

TRow[]

options

ClientRowModelOptions<TRow>

Returns

ClientRowModel<TRow>

Properties

mode

readonly mode: "client"

Defined in: datagrid-core/dist/index.d.ts:5911

Implementation of

RowModel.mode

Methods

compute()

compute(columns, query): RowModelResult<TRow>

Defined in: datagrid-core/dist/index.d.ts:5922

Synchronous core — exposed for tests and reused by the async getRows().

Parameters

columns

ColumnModel<TRow>

query

RowModelQuery

Returns

RowModelResult<TRow>


getRows()

getRows(columns, query): Promise<RowModelResult<TRow>>

Defined in: datagrid-core/dist/index.d.ts:5923

Run the pipeline for the given query and return view rows.

Parameters

columns

ColumnModel<TRow>

query

RowModelQuery

Returns

Promise<RowModelResult<TRow>>

Implementation of

RowModel.getRows


getSourceRows()

getSourceRows(): readonly TRow[]

Defined in: datagrid-core/dist/index.d.ts:5920

The full source array (client models); used for distinct-value lists.

Returns

readonly TRow[]

Implementation of

RowModel.getSourceRows


getTotalCount()

getTotalCount(): number

Defined in: datagrid-core/dist/index.d.ts:5917

Total number of source rows (client) / last known server count (remote).

Returns

number

Implementation of

RowModel.getTotalCount


patchData()

patchData(rows, changedSourceIndices, _columns?): void

Defined in: datagrid-core/dist/index.d.ts:5919

setData for the case where the caller KNOWS which source indices differ — a transaction that only updates rows (gap analysis P1.14).

Same contract as setData otherwise: rows is a new array and replaces the old one. The extra information lets the model keep the row nodes it already built for the untouched indices, which at a million rows is the difference between rebuilding a million nodes and rebuilding a thousand.

Callers must be exact. An index left out of changedSourceIndices is a promise that rows[i] is the SAME object as before.

Parameters

rows

TRow[]

changedSourceIndices

readonly number[]

_columns?

unknown

Returns

void

Implementation of

RowModel.patchData


setData()

setData(rows): void

Defined in: datagrid-core/dist/index.d.ts:5918

Replace the underlying data (client models only; no-op for remote).

Parameters

rows

TRow[]

Returns

void

Implementation of

RowModel.setData