mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
patch docs for #501
This commit is contained in:
parent
15a55030a2
commit
c633e95e01
@ -121,15 +121,15 @@ It's only used for [`column.formatter`](#formatter), you can define any value fo
|
|||||||
Enable the column sort via a `true` value given.
|
Enable the column sort via a `true` value given.
|
||||||
|
|
||||||
## <a name='sortFunc'>column.sortFunc - [Function]</a>
|
## <a name='sortFunc'>column.sortFunc - [Function]</a>
|
||||||
`column.sortFunc` only work when `column.sort` is enable. `sortFunc` allow you to define your sorting algorithm. This callback function accept four arguments:
|
`column.sortFunc` only work when `column.sort` is enable. `sortFunc` allow you to define your sorting algorithm. This callback function accept six arguments:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
// omit...
|
// omit...
|
||||||
sort: true,
|
sort: true,
|
||||||
sortFunc: (a, b, order, dataField) => {
|
sortFunc: (valueA, valueB, order, dataField, rowA, rowB) => {
|
||||||
if (order === 'asc') return a - b;
|
if (order === 'asc') return valueA - valueB;
|
||||||
else return b - a;
|
else return valueB - valueA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user