* 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:
Allen
2017-10-20 00:44:25 -05:00
committed by GitHub
parent cb6410bbe4
commit 10f06dca10
12 changed files with 424 additions and 33 deletions
+1 -1
View File
@@ -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
+40
View File
@@ -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 ...; }
};
```