mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-07-01 06:30:11 +00:00
fix #128
* implement custom row classes * add story for customizing row classes * add test for rowClasses * patch docs for rowClasses
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
* [cellEdit](#cellEdit)
|
||||
* [selectRow](#selectRow)
|
||||
* [rowStyle](#rowStyle)
|
||||
* [rowClasses](#rowClasses)
|
||||
* [defaultSorted](#defaultSorted)
|
||||
|
||||
### <a name='keyField'>keyField(**required**) - [String]</a>
|
||||
@@ -62,6 +63,23 @@ const rowStyle = (row, rowIndex) => {
|
||||
<BootstrapTable data={ ... } columns={ ... } rowStyle={ rowStyle } />
|
||||
```
|
||||
|
||||
### <a name='rowClasses'>rowClasses = [String | Function]</a>
|
||||
Custom the style of table rows:
|
||||
|
||||
```js
|
||||
<BootstrapTable data={ ... } columns={ ... } rowClasses="custom-row-class" />
|
||||
```
|
||||
|
||||
This prop also accept a callback function for flexible to custom row style:
|
||||
|
||||
```js
|
||||
const rowClasses = (row, rowIndex) => {
|
||||
return 'custom-row-class';
|
||||
};
|
||||
|
||||
<BootstrapTable data={ ... } columns={ ... } rowClasses={ rowClasses } />
|
||||
```
|
||||
|
||||
### <a name='defaultSorted'>defaultSorted - [Array]</a>
|
||||
`defaultSorted` accept an object array which allow you to define the default sort columns when first render.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user