I have a DataTable where I implemented a custom sorting function like this:
Code: Select all
sortField(e: ColumnSortParams) {
let rows = [...this.state.rows]
rows.sort((a, b) => {
//my custom sorting logic
});
return rows;
}
In particular, I have a custom filterFunction on some columns, and:
- If the table is filtered and I sort a column, the filters gets lost and all the data is displayed
- If the table is sorted and I filter a column, the filter doesn't get applied