mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-06-28 21:20:04 +00:00
fix #108
* implement selectRow.bgColor * add story for selectRow.bgColor * add testing for selectRow.bgColor * patch docs for selectRow.bgColor
This commit is contained in:
@@ -11,6 +11,7 @@ The following are available properties in `selectRow`:
|
||||
* [mode (**required**)](#mode)
|
||||
* [style](#style)
|
||||
* [classes)](#classes)
|
||||
* [bgColor](#bgColor)
|
||||
* [nonSelectable)](#nonSelectable)
|
||||
|
||||
#### Optional
|
||||
@@ -88,6 +89,27 @@ const selectRow = {
|
||||
};
|
||||
```
|
||||
|
||||
## <a name='bgColor'>selectRow.bgColor - [String | Function]</a>
|
||||
The backgroud color when row is selected
|
||||
|
||||
```js
|
||||
const selectRow = {
|
||||
mode: 'checkbox',
|
||||
bgColor: 'red'
|
||||
};
|
||||
```
|
||||
|
||||
There's also a more good way to custom it:
|
||||
|
||||
```js
|
||||
const selectRow = {
|
||||
mode: 'checkbox',
|
||||
bgColor: (row, rowIndex) => {
|
||||
return ....; // return a color code
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## <a name='nonSelectable'>selectRow.nonSelectable - [Array]</a>
|
||||
This prop allow you to restrict some rows which can not be selected by user. `selectRow.nonSelectable` accept an rowkeys array.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user