• Resolved OtaQ

    (@otaq)


    Next problem ??

    I got a row called “RATING” and the numbers are like “1, 2, 3, 4, 5, 6, 7, 8, 9, 10”

    If I click on the sorting (the “title” RATING at the top), 9 is on the top !??? so… I don′t understand this.. the 10 of course should be on top…

Viewing 7 replies - 1 through 7 (of 7 total)
  • flamenco

    (@flamenco)

    Hi,
    Ah, you’re not a programmer, then, otherwise there would be no “of course” in there. ?? At first, I thought you were simply running into text vs. number sorting, a very common programming problem. When using a text sort, “9” may be higher than “10” because of the first digit.

    But I tested the sorting in mine, and I cannot break it! It works great with any number I’m using.

    And I assume you actually meant sorting on a column rather than a row, as it only sorts on columns.

    So I don’t know. Maybe if you give a link someone can help you further.

    Thread Starter OtaQ

    (@otaq)

    Column is correct ?? Sorry for my bad english!

    Hi,

    yes, this likely is a text vs. number sorting issue.
    Please provide the URL to the page with the table.

    Regards,
    Tobias

    Thread Starter OtaQ

    (@otaq)

    I sent you a email with the link.

    Hi,

    just for reference for everybody:
    This was indeed a text/number sorting issue:
    German number values, which contain a , instead of a . caused DataTables to treat the column as text, and thus the sorting was different.
    Changing all , to . in the column helped.

    Best wishes,
    Tobias

    Hey Tobias,

    It’s Mike again ??

    I’m trying to fixe a sorting problem and I would like to add a plugin for natural sorting and currency sorting as founded on:

    https://datatables.net/plug-ins/sorting

    on the a Naturalsort algorithm bu Jim Palmer:

    https://www.overset.com/2008/09/01/javascript-natural-sort-algorithm-with-unicode-support/

    I’m not a programmer, but some copy-past work is no problem off course, so where do I have to put this codes, or do I have to make files for it and where do I have to store these??

    Hope to hear from you!

    Mike

    Hi Mike,

    I don’t have details on how to add that specific natural sort algorithm, and unfortunately I’m not an expert with JavaScript, so I won’t be able to help with this.
    There is however some code from the past that you can use as a starting point. It is based on the DataTables website, to integrate different plugins from there.
    You can find those files (basically, they are WordPress plugins) at https://tobias.baethge.com/download/plugins/additional/.

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP-Table Reloaded] Sorting by Number?’ is closed to new replies.