WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Sorting URLs with currency and text as numbers

[Resolved] Sorting URLs with currency and text as numbers

  • Hi Tobias,

    First of all I want to thank you for this great plugin!

    I’m working on a table that’s got numbers and text as links, please see vergelijkingzorgverzekeringen2013.nl, third column.

    What I want it to do is sort everything as a number. I’ve read about the currency plugin and tried installing it and adding "aoColumnDefs": [ { "sType": "currency_sorting", "aTargets": [ "column-3" ] }] but this doesn’t do it. Can this be done?

    I have to say I’ve got no Javascript knowledge at all, but hoping you can help me here.

    Regards,

    Ramon

    http://wordpress.org/extend/plugins/wp-table-reloaded/

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

    @tobiasbg

    Hi Ramon,

    thanks for your question!

    I’m afraid that this is not that easy in your case. The reason basically is that you have a mixed data type in that column. It is a currency that also is a HTML link. Therefore, you will need some custom sorting method for that column, i.e. basically a combination of the default HTML type (which you can likely find in the DataTables source code) and the currency type from that extension plugin.
    Unfortunately, my knowledge about DataTables doesn’t go far enough to develop this, sorry 🙁

    Also, instead of the European currency plugin, you might want to try the plugin http://tobias.baethge.com/download/plugins/additional/wp-table-reloaded-currency-sorting.zip (but you still need the handling of hte HTML, or remove the link around the currency value).

    Regards,
    Tobias

    Hi Tobias,

    Thanks for the quick response. I’ve tried putting the ‘€’ outsite of the link, but unfortunately that didn’t solve it. Do you see any other possible sollution? Back-up plan is removing the link alltogether.

    Thanks!
    Ramon

    Plugin Author TobiasBg
    Participant

    @tobiasbg

    Hi Ramon,

    the problem likely is that your link also contains numbers. You’ll have to consider removing the link from that column, as it seems, or really come up with and develop a custom sorting algorithm.

    Regards,
    Tobias

    Hi Tobias,

    I’ve got zero experience developing JS algorithms, so I’ll go for the most suitable solution: removing the links.

    Thanks for the prompt replies!

    Ramon

    Plugin Author TobiasBg
    Participant

    @tobiasbg

    Hi Ramon,

    yes, that’s the best option then. I also don’t have experience in developing custom sorting algorithms 🙁

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Sorting URLs with currency and text as numbers’ is closed to new replies.