DataSource Props
In the API Reference below we'll use DATA_TYPE
to refer to the TypeScript type that represents the data the component is bound to.
aggregationReducers
Specifies the functions to use for aggregating data. The object is a map where the keys are ids for aggregations and values are object of the shape described below.
data
Specifies the data the component is bound to. Can be one of the following:
defaultFilterValue
Uncontrolled prop used for filtering. Can be used for both client-side and server-side filtering.
defaultRowSelection
Describes the selected row(s) in the DataSource
defaultSortInfo
Information for sorting the data. This is an uncontrolled prop.
filterDelay
The delay in milliseconds before the filter is applied. This is useful when you want to wait for the user to finish typing before applying the filter.
filterFunction
A function to be used for client-side filtering.
filterMode
Explicitly configures where filtering will take place
filterTypes
Specifies the available types of filters for the columns.
filterTypes.components.FilterEditor
A custom React component to be used as an editor for the current filter type
filterValue
Controlled prop used for filtering. Can be used for both client-side and server-side filtering.
lazyLoad
Whether the datasource will load data lazily - useful for server-side grouping and pivoting. If set to true
or to an object (with batchSize
property), the data
prop must be a function that returns a promise.
groupBy
An array of objects with field
properties, that control how rows are being grouped.
groupBy.column
An object that configures how the column for the current group should look like
livePagination
Whether the component should use live pagination.
onDataMutations
Callback prop to be called when the data changes via the DataSource API.
livePaginationCursor
A cursor value for live pagination. A good value for this is the id of the last item in the data
array. It can also be defined as a function
onDataParamsChange
A function to be called when data-related state changes.
onFilterValueChange
Callback prop called when the filterValue
changes.
onLivePaginationCursorChange
A function to be called when the livePaginationCursor
changes.
onReady
The callback that is called when the DataSource
is ready. The dataSourceApi
is passed as the first argument.
onRowSelectionChange
A function to be called when the rowSelection
changes.
onSortInfoChange
Called when sorting changes on the DataSource.
refetchKey
A value that can be used to trigger a re-fetch of the data.
rowSelection
Describes the selected row(s) in the DataSource
selectionMode
Specifies the type of selection that should be enabled.
sortFunction
Custom sorting function to replace the multisort
function used by default.
sortInfo
Information for sorting the data. This is a controlled prop.
sortMode
Specifies where the sorting should be done.
sortTypes
Describes the available sorting functions used for local sorting. The object you provide will be merged into the default sort types.
useGroupKeysForMultiRowSelection
Specifies whether rowSelection
contains group keys or only row ids/primary keys.