• Love the plugin and for the most part it works just like it is supposed to.

    I am importing a spreadsheet of foreclosed properties and one of the columns is price. It is formatted xx,xxx. Someone commented that this column didn’t sort correctly when they used the arrows and I tested it to see. At first it looked like it worked fine but then I noticed that 8,900 was showing above 79,900 and 52,000 was showing above 500,000. I don’t know if it has to do with the way the numbers are formatted or what but it would be good to have it be able to sort these numbers correctly.

    Any ideas on changes I could make to accomplish this.

    Thanks,
    ROn

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

    (@tobiasbg)

    Hi,

    yes, this has to do with how the numbers are formatted.
    The DataTables JavaScript library does not handle commas in numbers by default and then thinks that the column contains strings and not numbers – which are sorted differently.
    You could either remove all the commas to make the sorting work, or you could try to install the “comma values Extension” from here: https://tobias.baethge.com/download/plugins/additional/wp-table-reloaded-commavalues.zip
    Just install this as a regular WordPress plugin.

    Regards,
    Tobias

    Hi Tobias – I have the same issue as above with the commas not sorting. I installed the commavalue.zip as a regular plugin and no luck. Am I missing something? https://www.rapdevpro.com/app-review-sites/

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question.

    I’m not exactly sure why it happens, but as it seems the automatic recognition of the data type is not working.
    You can however try to set the type manually. For that, please paste the following into the “Custom Commands” textfield in the “DataTables JavaScript features” section on the “Edit” screen of your table:

    "aoColumnDefs": [ { "sType": "html", "aTargets": [ 1 ] } ]

    Additionally, I really highly recommend that you update your WordPress version to the latest!

    Best wishes,
    Tobias

    Thank you so much for the reply!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sort by price not working right’ is closed to new replies.