WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WP-Table Reloaded] WP Table Reloaded sorting links (5 posts)

  1. kgagne
    Member
    Posted 4 years ago #

    Hello,

    Fantastic plugin! My data have never been better organized.

    I have two tables that aren't sorting as I would expect. When clicking the "Format" column here:

    http://www.kansasfest.org/downloads/

    or "Medium" here:

    http://www.kansasfest.org/gallery/

    The results are not alphabetical. Is the plugin sorting by the contents of the cell (including HTML hyperlink), as opposed to what's actually being displayed?

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

  2. TobiasBg
    Member
    Posted 4 years ago #

    Hi,

    you should be able to fix that on those tables, by telling DataTables, that those two columns contain HTML. Then, the script will sort on the text of the link and not the actual HTML.
    To achieve that, you will need to add a command to the "Custom Commands" textfield in the "DataTables JavaScript Features" section on the "Edit" screen of those two tables.

    For the downloads one, add this code:

    "aoColumns": [ null, null, null, null, { "sType": "html" }, null ]

    For gallery table, add this:

    "aoColumns": [ null, null, { "sType": "html" }, null, null ]

    Hope that helps :-)

    Best wishes,
    Tobias

  3. kgagne
    Member
    Posted 4 years ago #

    Tobias,

    I wish all plugin authors were as timely and detailed with their help! Thanks so much. Since I don't know JavaScript, I doubt I could've figured this out on my own.

    With your suggestions as a basis, I think I can address this issue on other tables, should I encounter it in the future. I also changed the code for the aforementioned downloads table to this:

    "aoColumns": [ null, null, null, null, { "sType": "html" }, { "sType": "html" } ]

    You rock!

    -Ken

  4. TobiasBg
    Member
    Posted 4 years ago #

    Hi Ken,

    thanks for your nice words, I appreciate it! :-)

    And your change to the code is perfectly correct :-)

    Best wishes,
    Tobias

  5. misksh
    Member
    Posted 4 years ago #

    This worked great for me at my page.
    Thanks much!

Topic Closed

This topic has been closed to new replies.

About this Topic