WordPress.org

Ready to get started?Download WordPress

Forums

WP-Table Reloaded
[resolved] Custom Sorting Command (4 posts)

  1. reedbird8
    Member
    Posted 1 year ago #

    I'd like to enable my tables to be returned to the original heirarchichal order from the table, which is different than any one of the columns being sorted alphabetically.

    Any way to make this happen?

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

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    there might have been some miscommunication in my tweet leading to this post: For this, a "Custom Command" is not enough unfortunately. Instead, you will need to call a custom DataTables API function via some JavaScript code, which you can find at http://datatables.net/plug-ins/api#fnSortNeutral You could for example add a button to your page and execute that code when the button is clicked.

    The "Custom Command" that I mentioned was targeted at being able to exclude columns from being sortable. That is possible by adding

    "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0, 2, 3 ] } ]

    to the "Custom Commands" textfield in the "DataTables JavaScript features" section on the "Plugin Options" screen of WP-Table Reloaded.
    This example would make columns 1, 3, and 4 non-sortable (counting starts with 0).

    Regards,
    Tobias

  3. reedbird8
    Member
    Posted 1 year ago #

    Thanks, Tobias. Appreciate all your assistance!

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    sure, no problem! You are very welcome!

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic