react-bootstrap-table2/docs/row-selection.md
Allen 4f7a3d7eaf refine row selection
* adjust propType order

* rename for resolving selectRow prop

* refine row selection

* refine document
2017-10-18 01:13:06 -05:00

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

  • radio
  • checkbox

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 }
/>