tristen / tablesort

:arrow_up_down: A small tablesorter in plain JavaScript
https://tristen.ca/tablesort/demo/
MIT License
1.1k stars 179 forks source link

add th attribute data-sort-reverse #184

Open zevero opened 4 years ago

zevero commented 4 years ago

I needed to have different sort order for columns Honoring the global option descending:true and avoiding any asc, desc logic I just added the attribute data-sort-reverse.

tristen commented 4 years ago

👋 @zevero thanks for the PR. I'm curious why aria-sort isn't enough and why a data-sort-reverse attribute is necessary.

zevero commented 4 years ago

Thanks for your quick response @tristen ! I tried aria-sort on my column and yes it seemed to work initially. But when sorting another column in between aria-sort ends up beeing cleared and from now on that column will be sorted contrary as expected. So thats why I introduced an everlasting data-sort-reverse ;-)