WordPress.org

Ready to get started?Download WordPress

Forums

WP-Table Reloaded
[resolved] Sorting URLs with currency and text as numbers (6 posts)

  1. Ramonv
    Member
    Posted 1 year ago #

    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/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. Ramonv
    Member
    Posted 1 year ago #

    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

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

  5. Ramonv
    Member
    Posted 1 year ago #

    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

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Ramon,

    yes, that's the best option then. I also don't have experience in developing custom sorting algorithms :-(

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.