How can i disable the event of column sorting using datatable api

How can i disable the event of column sorting using datatable api

alang2205alang2205 Posts: 18Questions: 11Answers: 0

i want to disable all columns sorting whe user clicks on th arrows
I have try using this

table.order( [ 1, [] ] ).draw();
i want to achive this usin the api not the options

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949
    Answer ✓

    I don't believe there is an API for this. The columns.orderable is the way to turn off the users ability to order the table. Why do you want to do this via an API?

    Kevin

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    As always, Kevin is spot on. There is no built in API to dynamically disable that ability. You can do it at start up time using the option mentioned, or you could just use jQuery to unbind the click event. It is possible to bind a new listener with the order.listener() listener method.

    Allan

Sign In or Register to comment.