mattiash / angular-tablesort

Sort angularjs tables easily
MIT License
184 stars 66 forks source link

How can I change sorting algorithm? #67

Closed mattiasnordqvist closed 7 years ago

mattiasnordqvist commented 8 years ago

Is is possible to change sorting algorithm. I need to override javascripts default sorting to handle some special cases.

RopoMen commented 7 years ago

Hi,

is tableSortConfigProvider.filterFunction what you are looking for? (see. readme)

or you can also use per table

<table ts-wrapper  ts-filter-function="customFilterFn">
mattiasnordqvist commented 7 years ago

filter doesn't sound like what I'm looking for. My problem is that the letters å and ä are sorted incorrectly in my Swedish application.

mattiash commented 7 years ago

I just merged PR #71 that uses Intl.Collator to sort strings. On second thought, I am however a bit uncertain if that patch is correct. But if it is correct, it ought to sort Swedish characters correctly if the user has a Swedish locale. Perhaps you could test that patch and see if it works for you?

mattiasnordqvist commented 7 years ago

I haven't looked into the code but it seems it solved my problem! :) thank you