How does Sorting work?

How does Sorting work?

mbaasmbaas Posts: 67Questions: 24Answers: 1

I don't have a live-link or sample, I'd like to discuss the theory first because I assume that I am missing something fundamental.
Basically I have a list of names that I'd like to sort. BUT these are germans, so there are umlauts in the names which leads to the effect of showning "Michael" before "Männer" which is wrong! (The ä should be treated like "ae" for sorting.)

So I browsed around and found "Natural Sorting" - sounds like what I need, but it turns out that natural also sorts such cases wrong. To my great surprise I could not even find the word "umlaut" on the other's site! So I assumed that I'd have to write it myself.
So I have a call jQuery.fn.dataTableExt.oSort['euro-sort'] = function(a,b) {...} and this function does a lot of string-replaces and finally returns -1/0/1. And the name-column is set up as {"title": "Nachname" , type: 'euro-sort'}.

Unfortunately that seems to be incomplete, because the columns still do not sort correctly. So I added a few console.log()-calls to the fn in order to see what exactly is happning these - and I get no output on the console! So obviously my niece piece of work is not even called once! What am I doing wrong???

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Try this plug-in (ignore the name - it is not specific to Chinese).

    Ultimately we need a plug-in based on the new Javascript i18n API to address this fully.

    Allan

  • mbaasmbaas Posts: 67Questions: 24Answers: 1

    Great, that does the job - thanks very much!

  • mbaasmbaas Posts: 67Questions: 24Answers: 1

    BTW: on the "My Account"-page there is "Form Threads"-section which still lists this discussion as "open" - isn't it automically closed when I selected that your reply solved the problem?

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    No - discussions are closed after a certain amount of time, typically 6 months.

    Allan

This discussion has been closed.