Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / LoadOptions

Interface: LoadOptions

Properties

filter?

optional filter?: FilterNode | null

Serializable — the same AST goes to worker or server.


group?

optional group?: GroupDescriptor[]


groupKeys?

optional groupKeys?: unknown[]

Path of the group being expanded, outermost value first (remote grouping). Empty (or absent) means the top level. Its LENGTH tells the server which level to return: with group: [region, category], groupKeys: ['Berlin'] asks for Berlin's categories, and ['Berlin', 'Toys'] asks for the data rows inside Berlin > Toys.


parentKey?

optional parentKey?: RowKey | null

Server-side tree (tree.hasChildren): the row whose children to return, null for the top level. Sort, filter and paging (skip / take) apply WITHIN that level; totalCount is the number of children it has. A filtered tree should keep the ancestors of a match — which rows those are is the server's to decide.


searchText?

optional searchText?: string


skip?

optional skip?: number


sort?

optional sort?: SortDescriptor[]


summaries?

optional summaries?: SummaryRequest[]

Footer totals to compute over the WHOLE filtered result — SUM(revenue), COUNT(*) and friends, not just the rows in this block.

type: 'custom' never appears here: a custom reducer is a JavaScript function on the client, and the server has no way to run it. A grid whose only aggregation is custom therefore sends nothing, and its footer stays empty on a remote source — which is the honest answer, not a bug.


take?

optional take?: number