Click on the title bar and do not sort the column in dataTables

0

Good morning. I am using dataTables and in one of the columns I put an input: checkbox for the user to be able to check or deselect all columns, remembering that in the columns I have how to do the ordering when I click on the title bar and in that column also has that. So far so good. What I am not sure how to do is that when the user clicks on the checkbox does not do the sorting, just do this sorting, because when he clicks to mark or unmark he already does the sorting, and this can not happen. How do I get the sort order from just this column?

    
asked by anonymous 22.04.2018 / 16:16

1 answer

0

You can disable sorting of the first column with:

$('#example').dataTable({
  "columnDefs": [
    {
      "orderable": false, 
      "targets": 0
    }
  ]
});

Take a look at documentation for more options

    
22.04.2018 / 17:38