• Resolved longnha

    (@longnha)


    Hi,

    My table has 8 columns, I want to disable sorting on columns 6,7,8. How can I do it please?

    I found some suggestion in old topics but it just not work for my case.

    Thank you.

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    This is possible with a “Custom Command” for the DataTables JS library. Please enter this into the “Custom Commands” textfield on the “Edit” screen of that table:

    "columnDefs": [ { "orderable": false, "targets": [ 5, 6, 7 ] } ]
    

    (Counting the columns starts with 0 in this code.)

    Regards,
    Tobias

    Thread Starter longnha

    (@longnha)

    Thank you, it works great. 🙂

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Disable sorting on a certain columns’ is closed to new replies.