@kanunilabs/datagrid-react / DataSource
Interface: DataSource<TRow>
Defined in: datagrid-core/dist/index.d.ts:988
Type Parameters
TRow
TRow = GridRowData
Methods
byKey()?
optionalbyKey(key):Promise<TRow|undefined>
Defined in: datagrid-core/dist/index.d.ts:990
Parameters
key
Returns
Promise<TRow | undefined>
load()
load(
options):Promise<LoadResult<TRow>>
Defined in: datagrid-core/dist/index.d.ts:989
Parameters
options
Returns
Promise<LoadResult<TRow>>
loadDistinctValues()?
optionalloadDistinctValues(options):Promise<DistinctValue[]>
Defined in: datagrid-core/dist/index.d.ts:1004
Distinct values of one column, for the header filter popup.
OPTIONAL, and the popup is offered only when it is implemented: a grid that holds a few cached blocks of a server-side table cannot derive this itself, and a checklist built from "whatever happens to be cached" is worse than no checklist — the user would tick four values believing they were all of them.
Deliberately NOT given the current filter. The client-side implementation computes distinct values over the FULL column precisely so that unticking a value never makes it vanish from the list; narrowing them server-side would make the two behave differently for no stated reason.
Parameters
options
DistinctValuesOptions
Returns
Promise<DistinctValue[]>