• Had another thread on this topic here: https://www.ads-software.com/support/topic/plugin-wp-table-reloaded-disabling-sort-for-only-one-column?replies=9

    Though the problem was solved, but something else came up. Instead of the two rows with the first one being sorted using this custom command

    "aoColumnDefs": [ { "bSortable": true, "aTargets": [ 0 ] }, { "bSortable": false, "aTargets": [ "_all" ] }, { "bSearchable": true, "aTargets": [ 0 ] }, { "bSearchable": false, "aTargets": [ "_all" ] } ]

    I need three columns with only the middle column sortable.

    PS: I don’t think its possible, but I thought I’d ask anyway. Is it possible to let the user choose which column is being sorted?

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

    (@tobiasbg)

    Hi,

    to make only the middle column of three columns sortable and searchabled, please try this code:

    "aoColumnDefs": [ { "bSortable": true, "aTargets": [ 1 ] }, { "bSortable": false, "aTargets": [ "_all" ] }, { "bSearchable": true, "aTargets": [ 1 ] }, { "bSearchable": false, "aTargets": [ "_all" ] } ]

    (only the 0 needs to be changed into a 1).

    I’m not sure what you mean with “let the user choose”, because the user can just click the column he wants to have it sorted…? So, no, that is not possible with other means. If with “user” you mean the person creating/editing the table, then that it is only possible by changing that code from above.

    Best wishes,
    Tobias

    Thread Starter MaceEcam

    (@maceecam)

    ( : I get it. The “aTargets” refers to which column is being references. Thank you.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    exactly ?? There’s one “aTargets” that enables a feature for a certain column, and one that (first) disables the feature for all (keyword “_all”) columns. And that for the two features sorting and Filtering/Searching.

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP-Table Reloaded] Sort one column’ is closed to new replies.