• Resolved mathse

    (@mathse)


    Hello,
    I have a simple example table created, with a German date in the first column.
    The cvs file, which I import with Tablepress is upoaded here:
    https://pastebin.ubuntu.com/p/yKzfZ2rc6n/

    I also have installed DataTables Sorting plugin. With just enabling this, sorting the “Datum” column does not work, so I added:

    
    "columnDefs": [ { "type": "formatted-num", "targets": [ 0 ] } ]
    

    To the commands of the table – which unfortunately does not help either.
    The ordering by date is wrong, here is a simple picture of the result:
    https://i.postimg.cc/TP52mw7s/20210328174249.png

    This is just a simple example, in reality I want to use it with a much bigger table – with the same problems. Sorting doesn’t work.
    Can anybody help me here?

    Thanks

    Mathias

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Please try using

    "columnDefs": [ { "type": "date-eu", "targets": [ 0 ] } ]
    

    as the “Custom Command”. You will need the date sorting algorithm here, not the one for formatted numbers.

    Regards,
    Tobias

    Thread Starter mathse

    (@mathse)

    Hello Tobias,

    thanks for the fast reply and help! That’s indeed it and this fixed the problem for me. I didn’t find this in the docs but it (of course) makes sense.

    Thanks for your help!

    May I ask one last question: Is sorting done locally or does ist use server ressources? I ask because I just have very limited resources on the server and would disable it, if it is done there.

    Greetings

    Mathias

    • This reply was modified 5 years, 1 month ago by mathse.
    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    And no worries, the sorting is done in the browser on the client-side. Your server has nothing to do with this 🙂

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘DataTables Sorting plugin not working as expected’ is closed to new replies.