Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter strandcreative

    (@strandcreative)

    Okay so I managed to install the extension and the date has automatically sorted. Does anybody know how to sort by decimal points? E.g. 11 miles is coming before 7.8 miles when sorting from lowest (shortest) to highest (farthest) when it should be the other way round

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The problem here is the “miles” part of those cells. Those basically make the sorting library use an algorithm that sorts the cells as strings and not as numbers. That’s why you get the seemingly wrong results.
    It might work to force a different algorithm, by adding this to the “Custom Commands” textfield on the “Edit” screen of the table:

    "aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 3 ] } ]

    Regards,
    Tobias

    Thread Starter strandcreative

    (@strandcreative)

    Thanks Tobias! It has worked. Genius

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

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

    Best wishes,
    Tobias

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

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

The topic ‘Sort by Date and Distance’ is closed to new replies.