SelectionState Plugin Reference

A plugin that manages the selection state.

Import

Use the following statement to import the plugin:

import { SelectionState } from '@devexpress/dx-react-grid';

User Reference

Dependencies

none

Properties

Name Type Default Description
selection? Array<number | string>   The selected row’s IDs.
defaultSelection? Array<number | string> [] The initially selected rows in the uncontrolled mode.
onSelectionChange? (selection: Array<number | string>) => void   Handles selection changes.

Plugin Developer Reference

Imports

Name Plugin Type Description
rows Getter Array<any> Rows to be rendered.
getRowId Getter (row: any) => number | string A function used to get a unique row identifier.

Exports

Name Plugin Type Description
toggleSelection Action ({ rowIds: Array<number | string>, state?: boolean }) => void A function that selects/deselects rows. The state argument specifies whether the rows should be selected (true), deselected (false), or their selection status should be set to the opposite value (undefined). To select/deselect a single row, pass an array with a single item to the rowIds argument.
selection Getter Array<number | string> The selected row’s IDs.