Sort columns based on one primary
Sort columns based on one primary
I have 5 columns on my table and the first one is a boolean, the other columns have to be sorted following that first column sort.
This is what I have:
var table = $('#example').DataTable({
"language": {
search: '', searchPlaceholder: "Type to Search"},
//"orderFixed": {
// "pre": [ 0, "desc" ]},
"order": [0, "desc"],
"columnDefs":[
{"orderable": false, "targets": [4]},
{"targets": [1], "searchable": false, "visible": false},
{"orderData": [1], "targets": [0]}
]
});
I tried using orderFixed but I want to be able to sort that first column as well, I tried using events but it didn't work as expected.
I'm using an invisible column to sort that boolean column because I have an icon there but that's working fine.
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin