Disable Column Sort when Checkbox in Header is Clicked

Disable Column Sort when Checkbox in Header is Clicked

tcbeatontcbeaton Posts: 16Questions: 0Answers: 0
edited December 2012 in DataTables 1.9
I have added a check box in the header to show/hide additional columns of the table. When the check box is clicked, the column is sorted; is there any way to retain the column sort IF the header text is clicked, but NOT when clicking the check box? I've tried placing "return false" in the onClick, but the sort appears to happen prior to the onClick. Thanks for the help. :-)

Core POP

Replies

  • ulrikeulrike Posts: 39Questions: 1Answers: 0
    Try to disable sorting for the column. See the bSortable option here http://www.datatables.net/ref
  • tcbeatontcbeaton Posts: 16Questions: 0Answers: 0
    Hi Ulrike, I ended up moving the show/hide checkbox out of the header. Unfortunately, I couldn't disable sorting, since I needed that feature, as well. Thanks for the suggestion, sorry for the delay in getting back to you.
This discussion has been closed.