• Resolved misiek440

    (@misiek440)


    hello i have problem witch sorting, ET is wrong. How to fix it? Sory for poor english

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The reason for this is that you are sorting text (numbers with units) here and not pure numbers. Text sorting works one character at a time, from left to right, while number sorting compares the full numbers.

    Possible solutions:
    – Just put the unit (s or km/h) into the table header row, so that only numbers are in the data cells.
    – Or use the TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/ with the described formatted-num sorting algorithm.

    Regards,
    Tobias

    Thread Starter misiek440

    (@misiek440)

    Thank you, it works. I have one more problem, I need the first column to not sort with the rest of the columns, which is static. I tried to use = Row + 1 but it is still sorted

    Thread Starter misiek440

    (@misiek440)

    ok got it ??
    "columnDefs": [ { "type": "formatted-num", "targets": [ 7, 8, 9, 10, 11 ] }, { "orderable": false, "targets": 0 } ]

    and
    [table id=5 datatables_counter_column=true /]

    Thanks

    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 ‘Sorting time’ is closed to new replies.