mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-10-05 09:37:33 +00:00
fix #104
* implement row seleciton style and class * add testing for row selection style and class * refine select row test * add stories for row selection style and class * add docs for row selection style and class * patch for wrong docs
This commit is contained in:
+1
-1
@@ -478,7 +478,7 @@ Or take a callback function
|
||||
}
|
||||
```
|
||||
|
||||
## <a name='editCellClasses'>column.editCellClasses - [Object | Function]</a>
|
||||
## <a name='editCellClasses'>column.editCellClasses - [String | Function]</a>
|
||||
You can use `column.editCellClasses` to add custom class on `<td>` when cell editing. It's same as [`column.editCellStyle`](#editCellStyle) which also accept a callback function to able to custom your class more flexible. Following is the arguments of this callback function: `cell`, `row`, `rowIndex`, `colIndex`.
|
||||
|
||||
```js
|
||||
|
||||
@@ -9,6 +9,8 @@ The following are available properties in `selectRow`:
|
||||
|
||||
#### Required
|
||||
* [mode (**required**)](#mode)
|
||||
* [style](#style)
|
||||
* [classes)](#classes)
|
||||
|
||||
#### Optional
|
||||
|
||||
@@ -46,3 +48,41 @@ const selectRow = {
|
||||
selectRow={ selectRowProp }
|
||||
/>
|
||||
```
|
||||
|
||||
## <a name='style'>selectRow.style - [Object | Function]</a>
|
||||
`selectRow.style` allow you to have custom style on selected rows:
|
||||
|
||||
```js
|
||||
const selectRow = {
|
||||
mode: 'checkbox',
|
||||
style: { background: 'red' }
|
||||
};
|
||||
```
|
||||
|
||||
If you wanna more flexible customization, `selectRow.style` also accept a function:
|
||||
|
||||
```js
|
||||
const selectRow = {
|
||||
mode: 'checkbox',
|
||||
style: (row, rowIndex) => { return ...; }
|
||||
};
|
||||
```
|
||||
|
||||
## <a name='classes'>selectRow.classes - [String | Function]</a>
|
||||
`selectRow.classes` allow you to add css class on selected rows:
|
||||
|
||||
```js
|
||||
const selectRow = {
|
||||
mode: 'checkbox',
|
||||
classes: 'custom-class'
|
||||
};
|
||||
```
|
||||
|
||||
If you wanna more flexible customization, `selectRow.classes` also accept a function:
|
||||
|
||||
```js
|
||||
const selectRow = {
|
||||
mode: 'checkbox',
|
||||
classes: (row, rowIndex) => { return ...; }
|
||||
};
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user