mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
* adjust propType order * rename for resolving selectRow prop * refine row selection * refine document
1.0 KiB
1.0 KiB
Row selection
react-bootstrap-table2 supports the row selection feature. By passing prop selectRow to enable row selection. When you enable this feature, react-bootstrap-table2 will append a new selection column at first.
Available properties
The following are available properties in selectRow:
Required
Optional
selectRow.mode - [String]
Specifying the selection way for single(radio) or multiple(checkbox). If radio was assigned, there will be a radio button in the selection column; otherwise, the checkbox instead.
values
radiocheckbox
examples
const selectRow = {
mode: 'radio' // single row selection
};
<BootstrapTable
keyField='id'
data={ products }
columns={ columns }
selectRow={ selectRowProp }
/>
const selectRow = {
mode: 'checkbox' // multiple row selection
};
<BootstrapTable
keyField='id'
data={ products }
columns={ columns }
selectRow={ selectRowProp }
/>