Sort rows first based on selected checkboxes, then by other column
Sort rows first based on selected checkboxes, then by other column
I don't have much experience with DataTables and I'm using Checkboxes in order to select important rows jQuery DataTables. I'm trying to filter the rows based first on checkbox selection (selected should be on top) and second by other columns, like 'Name'/'Position'.
I've tried using "order": [[0, "asc"]]
in order to filter the column with checkboxes, but the filter does nothing
Is there a way to filter the rows automatically when a row is checked/unchecked (checked ones should always be on top) and then by other column filter?
Answers
You would need to do something like this example here. In the example, it's sorting on the value of an input element, for you, it would be similar but you would need to get the value of the checkbox instead,
Colin