react-bootstrap-table2 icon indicating copy to clipboard operation
react-bootstrap-table2 copied to clipboard

How can I remove sort order (display in original order)?

Open ziikki opened this issue 8 years ago • 4 comments

Hi Allen,

I have a column that supports both sorting and filtering, and I applied a remote filtering algorithm where the filtered value will display in the order based on similarity. The problem is that, once I clicked the sort button, the table would only display in ascending or desc order. Is it possible to clean previous sort status after any filter value updates, so it will display as how I ordered the dataset? Thanks!

ziikki avatar Jul 23 '18 21:07 ziikki

@zike-Q currently, we don't support the clean sort. I will consider to implement it. In your case, I think the workaround is you have to do the sort by yourself(remote sort).

But no sure if your cleaning sort is remove the sort order on specify column?

AllenFang avatar Jul 25 '18 02:07 AllenFang

In my case, it is to remove sort order on all columns and display the rows in the order same as the data array... If I need to implement remote sort and filter, do I define onTableChange event like this?

handleTableChange = (type, { sortField, sortOrder, data, filters }) => { 
if(type=="filter") }){ ... }
else if(type=="sort"){ ... }

By the way, if I want only my algorithm to work on one column, and use default filter (that came with the library) on other filter columns, is there a way to call your built-in filter & sort functions? Thanks.

ziikki avatar Jul 28 '18 20:07 ziikki

If I need to implement remote sort and filter, do I define onTableChange event like this?

correct

By the way, if I want only my algorithm to work on one column, and use default filter (that came with the library) on other filter columns, is there a way to call your built-in filter & sort functions? Thanks.

Currently, we don't implement the exposed API for operating on data, like filter or sort. But you can programmtically on filter, check this

For sorting, sorry we don't support yet

AllenFang avatar Jul 29 '18 03:07 AllenFang

Is there any plan to implement this or is there maybe a more convenient workaround by now?

CarstenEnglert avatar Oct 09 '19 14:10 CarstenEnglert