|
16 | 16 | * [clickToEdit](#clickToEdit) |
17 | 17 | * [onSelect](#onSelect) |
18 | 18 | * [onSelectAll](#onSelectAll) |
| 19 | +* [selectColumnPosition](#selectColumnPosition) |
19 | 20 | * [hideSelectColumn](#hideSelectColumn) |
20 | 21 | * [hideSelectAll](#hideSelectAll) |
21 | 22 | * [selectionRenderer](#selectionRenderer) |
22 | 23 | * [selectionHeaderRenderer](#selectionHeaderRenderer) |
23 | 24 | * [headerColumnStyle](#headerColumnStyle) |
| 25 | +* [selectColumnStyle](#selectColumnStyle) |
24 | 26 |
|
25 | 27 | ### <a name="mode">selectRow.mode - [String]</a> |
26 | 28 |
|
@@ -224,6 +226,42 @@ const selectRow = { |
224 | 226 | }; |
225 | 227 | ``` |
226 | 228 |
|
| 229 | +### <a name='selectColumnStyle'>selectRow.selectColumnStyle - [Object | Function]</a> |
| 230 | +A way to custome the selection cell. `selectColumnStyle` not only accept a simple style object but also a callback function for more flexible customization: |
| 231 | + |
| 232 | +### Style Object |
| 233 | + |
| 234 | +```js |
| 235 | +const selectRow = { |
| 236 | + mode: 'checkbox', |
| 237 | + selectColumnStyle: { backgroundColor: 'blue' } |
| 238 | +}; |
| 239 | +``` |
| 240 | + |
| 241 | +### Callback Function |
| 242 | +If a callback function present, you can get below information to custom the selection cell: |
| 243 | + |
| 244 | +* `checked`: Whether current row is seleccted or not |
| 245 | +* `disabled`: Whether current row is disabled or not |
| 246 | +* `rowIndex`: Current row index |
| 247 | +* `rowKey`: Current row key |
| 248 | + |
| 249 | + |
| 250 | +```js |
| 251 | +const selectRow = { |
| 252 | + mode: 'checkbox', |
| 253 | + selectColumnStyle: ({ |
| 254 | + checked, |
| 255 | + disabled, |
| 256 | + rowIndex, |
| 257 | + rowKey |
| 258 | + }) => ( |
| 259 | + // .... |
| 260 | + return { backgroundColor: 'blue' }; |
| 261 | + ) |
| 262 | +}; |
| 263 | +``` |
| 264 | + |
227 | 265 | ### <a name='onSelect'>selectRow.onSelect - [Function]</a> |
228 | 266 | This callback function will be called when a row is select/unselect and pass following three arguments: |
229 | 267 | `row`, `isSelect`, `rowIndex` and `e`. |
@@ -275,6 +313,16 @@ const selectRow = { |
275 | 313 | }; |
276 | 314 | ``` |
277 | 315 |
|
| 316 | +### <a name='selectColumnPosition'>selectRow.selectColumnPosition - [String]</a> |
| 317 | +Default is `left`. You can give this as `right` for rendering selection column in the right side. |
| 318 | + |
| 319 | +```js |
| 320 | +const selectRow = { |
| 321 | + mode: 'checkbox', |
| 322 | + selectColumnPosition: 'right' |
| 323 | +}; |
| 324 | +``` |
| 325 | + |
278 | 326 | ### <a name='hideSelectColumn'>selectRow.hideSelectColumn - [Bool]</a> |
279 | 327 | Default is `false`, if you don't want to have a selection column, give this prop as `true` |
280 | 328 |
|
|
0 commit comments