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.
batchOperationDelay
The delay in milliseconds to wait before mutations are applied. This is useful to batch multiple mutations together.
data
Specifies the data the component is bound to.
defaultFilterValue
Uncontrolled prop used for filtering. Can be used for both client-side and server-side filtering.
defaultRowDisabledState
The uncontrolled prop for managing row enabled/disabled state. For the controlled version see rowDisabledState
. For listening to row disabled state changes, see onRowDisabledStateChange
.
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.
filterModedeprecated
Explicitly configures where filtering will take place. Update to use the shouldReloadData.filterValue
prop.
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.
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
isRowDisabled
This function ultimately decides the disabled state of a row. It overrides both defaultRowDisabledState
/rowDisabledState
props.
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.
livePagination
Whether the component should use live pagination.
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
onCellSelectionChange
A function to be called when the cellSelection
changes.
onDataMutations
Callback prop to be called when the data changes via the DataSource API.
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.
onRowDisabledStateChange
Called when the row disabled state changes.
onRowSelectionChange
A function to be called when the rowSelection
changes.
onSortInfoChange
Called when sorting changes on the DataSource.
pivotBy
An array of objects with field
properties that control how pivoting works. Pivoting is very often associated with aggregations, so see related aggregationReducers
for more details.
primaryKey
The name of the id/primary key property of an item in the data
array. The value of this property needs to be unique.
refetchKey
A value that can be used to trigger a re-fetch of the data.
rowDisabledState
Manages row enabled/disabled state. For the uncontrolled version see defaultRowDisabledState
. For listening to row disabled state changes, see onRowDisabledStateChange
.
rowSelection
Describes the selected row(s) in the DataSource
selectionMode
Specifies the type of selection that should be enabled.
shouldReloadData
Specifies which changes in the data-related props should trigger a reload of the data source - applicable when data
is a function.
shouldReloadData.filterValue
Explicitly configures where filtering will take place and if changes in the filterValue
should trigger a reload of the data source - applicable when data
is a function.
Replaces the deprecated filterMode
sortFunction
Custom sorting function to replace the multisort
function used by default.
sortInfo
Information for sorting the data. This is a controlled prop.
sortModedeprecated
Specifies where the sorting should be done. Use shouldReloadData.sortInfo
instead.
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.