Kyslik / column-sortable

Package for handling column sorting in Laravel 5/6/7/8
MIT License
641 stars 105 forks source link

Sorting With Secondary Column #180

Open swarrenwecareconnectorg opened 3 years ago

swarrenwecareconnectorg commented 3 years ago

Hello. Thank you for the wonderful library.

We're running into an odd problem. We have a page that can be sorted on a date column and if a date spans two pages we run into random situations where the same items appear on both pages. It's been really inconsistent.

Is there some way to tell the library to sort based on the date and the id so the order is consistent across pages? If not, we would be interested in adding it as a feature.

Healyhatman commented 3 years ago

Does it work if you do ->sortable('date')->orderBy('id') ?

mr-bird-80 commented 1 year ago

@Healyhatman Thank you, this solution works for me perfectly.