AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.23k stars 782 forks source link

Multicolumn sort with a default/unchangeable primary column #1050

Open balzss opened 7 years ago

balzss commented 7 years ago

Hi, first of all thanks for putting this project together! My question is: can I make a column which will always be the primary sort column and is unchangeable and all the other columns are secondary but can change sort order. So for example I have a column with the data: is_active. I want to have the active rows at the top always but I want to be able to sort the active contracts by name or some other value. I know this explanation is all around the place, please let me know if I need to clarify it more.

Thanks!

AllenFang commented 7 years ago

I probably your requirement, so the is_active is a column with a fixed sorting order, and if the user click on the header for changing the order? did you allow it happen?

balzss commented 7 years ago

I'm storing contracts in the table and they have 4 properties: name(string), date(string), value(number), is_active(boolean).
I want to display the active contracts (where is_active true) always at the top. However I want to be able to sort the contracts by name, date, etc (while still keeping the active ones at the top).

AllenFang commented 7 years ago

@balzss, ok, umm, we dont support this kind of feature, I'll try yo support it in the future. Anyway, PR is welcome :)