Infinite Table Row Selection API

Configuring the selection mode to be 'multi-row'
<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

Boolean getter to report whether all the rows are selected or not

deselectAll

() => void

Deselects all the rows in the DataSource.

deselectGroupRow

(groupKeys: any[]) => void

Deselects the group row that is identified by the given group keys. Only makes sense when the DataSource is grouped.

deselectRow

(primaryKey: any, groupKeys?: any[]) => boolean

Deselects the specified row. Optionally provide the group keys, if you have access to them.

getGroupRowSelectionState

(groupKeys: any[], rowSelection?: DataSourceRowSelection) => true|false|null

Returns the state of a group row - only applicable when the DataSource is grouped

getSelectedPrimaryKeys

(rowSelection?: DataSourceRowSelection) => (string|number)[]

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

(primaryKey: any, groupKeys?: any[]) => boolean

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

(primaryKey: any, groupKeys?: any[]) => boolean

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

() => void

Selects all the rows in the DataSource.

selectGroupRow

(groupKeys: any[]) => void

Selects the group row that is identified by the given group keys. Only makes sense when the DataSource is grouped.

selectRow

(primaryKey: any, groupKeys?: any[]) => boolean

Selects the specified row. Optionally provide the group keys, if you have access to them.

toggleGroupRowSelection

(groupKeys: any[]) => void

Toggles the selection of the group row that is identified by the given group keys. Only makes sense when the DataSource is grouped.

toggleRowSelection

(primaryKey: any, groupKeys?: any[]) => boolean

Toggles the selection of the specified row. Optionally provide the group keys, if you have access to them.