• Resolved robrat

    (@robrat)


    Great plugin, and I know from extensive Googling that this is a Datatables thing that I don’t get, but perhaps someone can help me?

    The plugin seems to sort data as such:
    1.2
    1.3
    10.1
    11.0
    2.5
    2.6
    20.6
    3.0

    Do you see what I mean? ie. it’s sorting the data so that the first number dictates where in the sort it goes. The only way I can think to correct this is by writing all the data with as ‘03.1’ or similar to ensure it all has the same amount of digits but it looks horrible. Am I missing something really basic?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    very likely the DataTables library does this, because it does not recognize the type of your data in that column correctly.
    For example, as soon as there is something that resembles a string rather than a number in the column, the sorting will need to sort the column as strings (which are sorted differently than numbers).

    So, you should check whether your column contains anything that is not a number of the format x.y, e.g. a cell that contains letters or characters.

    If you provide the URL to your table, I’ll also take a look, if you want.

    Best wishes,
    Tobias

    Thread Starter robrat

    (@robrat)

    Ah, yes that’s completely cracked it. 3 of the lines of data had the words ‘New entry’ so it was interpreting as a string not number. I think I was approaching the whole thing at a far too techy level, so did (as I suspected) miss the obvious.

    Really thanks for that.

    Rob

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-Table Reloaded] Don't understand data sort’ is closed to new replies.