Infinite Table Row Selection API
<DataSource selectionMode="multi-row" />
// can be "single-row", "multi-row", "multi-cell" or false
Note
To enable multi-row selection, you need to specify selectionMode="multi-row"
on the <DataSource />
component.
You can retrieve the row selection api by reading it from the api.rowSelectionApi
property.
const onReady = ({api}: {api:InfiniteTableApi<DATA_TYPE>}) => {
// do something with it
api.rowSelectionApi.selectGroupRow(['USA'])
}
<InfiniteTable<DATA_TYPE>
columns={[...]}
onReady={onReady}
See the Infinite Table API page for the main API. See the Infinite Table Cell Selection API page for the cell selection API. See the Infinite Table Column API page for the column API. See the Infinite Table Row Detail API page for the row detail API (when master-detail is configured).
allRowsSelected
Boolean getter to report whether all the rows are selected or not
deselectAll
Deselects all the rows in the DataSource.
deselectGroupRow
Deselects the group row that is identified by the given group keys. Only makes sense when the DataSource is grouped.
deselectRow
Deselects the specified row. Optionally provide the group keys, if you have access to them.
getGroupRowSelectionState
Returns the state of a group row - only applicable when the DataSource is grouped
getSelectedPrimaryKeys
Retrieves the ids (primary keys) of the selected rows, when the selection contains group keys instead of primary keys (so when useGroupKeysForMultiRowSelection
is true
and the DataSource is grouped).
isRowDeselected
Checks if a row specified by its primary key is deselected or not. Optionally provide the group keys, if you have access to them.
isRowSelected
Checks if a row specified by its primary key is selected or not. Optionally provide the group keys, if you have access to them.
selectAll
Selects all the rows in the DataSource.
selectGroupRow
Selects the group row that is identified by the given group keys. Only makes sense when the DataSource is grouped.
selectRow
Selects the specified row. Optionally provide the group keys, if you have access to them.
toggleGroupRowSelection
Toggles the selection of the group row that is identified by the given group keys. Only makes sense when the DataSource is grouped.
toggleRowSelection
Toggles the selection of the specified row. Optionally provide the group keys, if you have access to them.