tofsjonas / sortable

Vanilla JavaScript table sort
The Unlicense
423 stars 49 forks source link

Empty rows always last possible? #54

Closed nepsilon closed 1 year ago

nepsilon commented 1 year ago

Is it possible to make empty rows always last after sorting? Similar to what SQL does with ORDER BY foo NULLS LAST.

So that no matter ascending or descending sort is applied on a column, empty values will always be at the bottom.

tofsjonas commented 1 year ago

I don't see why not. Thanks for your suggestion! 😊️

nepsilon commented 1 year ago

That was fast! Thanks Jonas.

I tested it and here is some feedback:

tofsjonas commented 1 year ago

Looks like you discovered a much older bug. Cool. Thanks again! 🙏️

nepsilon commented 1 year ago

Thanks for your prompt reply to this!

I tested it again and confirm n-last now works with data-sort 👍