You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In above case, when user try to sort Job Type column which will sort the original value: 0, 1, 2 but we display the type name via [`column.formatter`](#formatter), which will lead confuse because we are sorting by type value instead of type name. So `sortValue` is a way for you to decide what kind of value should be adopted when sorting on a specify column:
165
+
166
+
```js
167
+
constcolumns= [{
168
+
dataField:'id',
169
+
text:'Job ID'
170
+
}, {
171
+
dataField:'type',
172
+
text:'Job Type'
173
+
sort:true,
174
+
formatter: (cell, row) => types[cell],
175
+
sortValue: (cell, row) => types[cell] // we use type name to sort.
`column.sortFunc` only work when `column.sort`is enable. `sortFunc` allow you to define your sorting algorithm. This callback function accept six arguments:
180
+
`column.sortFunc` only work when `column.sort`enabled. `sortFunc` allow you to define your sorting algorithm. This callback function accept six arguments:
146
181
147
182
```js
148
183
{
@@ -421,7 +456,7 @@ If the events is not listed above, the callback function will only pass the `eve
421
456
{
422
457
// omit...
423
458
headerEvents: {
424
-
onClick:e=> { ... }
459
+
onClick:(e, column, columnIndex)=> { ... }
425
460
}
426
461
}
427
462
```
@@ -631,7 +666,7 @@ It's also available to custom via a callback function:
0 commit comments