react-bootstrap-table2
react-bootstrap-table2 copied to clipboard
sortFunc is not called
I confirm in [email protected], onSort and sortFunc aren't working.
For example, in columns definition, something like that does not logged anything to console :
{
dataField: 'id',
text: 'Product ID',
sort: true,
sortFunc: (a, b, order, dataField, rowA, rowB) => {
console.log('sortFunc');
if (order === 'asc') {
return b - a;
}
return a - b; // desc
},
onSort: (field, order) => {
console.log('onSort');
}
}
It used to work in [email protected].
Issue related : #1340
Did I miss something ?
Thanks for you help.
Hi @jchirschy, the sort functions seem to be working properly, I have created an example so you can test it. Check the console and you can notice the functions are been called.
Here is the version that I'm using.
react-bootstrap-table-next: 4.0.3
react-bootstrap-table2-filter: 1.3.3
react: 17.0.2
react-dom: 17.0.2
react-scripts: 4.0.0
Hope it helps.