Enable/disable column sorting event
Enable/disable column sorting event
bootstrap-fortuna
Posts: 2Questions: 0Answers: 0
How can i disable and enable sorting in datatable after generating the datatable. Suppose when select any chekbox of any row depend my datatable sorting will disable and after dselect it will again enable.
I have implement this code $('.dataTables_scrollHead thead th').off('click.DT'); it disable the sorting event. But I can not again bind the click event. Please help how can i solve the situation.
This discussion has been closed.
Replies
You've got the right way to remove the event (its a bit ugly, but it works!).
To add an event listener you can use
order.listener()
to attach DataTables sorting listener to a column again.Allan
Thanx for reply. I have use this but not working. my sorting is disabled but not enabled. Please help me for any other solutions
You'd need to give me a link to a JSFiddle showing the issue so I can offer any help.
Allan