Syntax for multi-column sorting
Syntax for multi-column sorting
brianK
Posts: 9Questions: 5Answers: 0
When a user clicks on column 1 (the second column, they are 0-based right?), I want to sort on 1, and then if they are the same, soft on column 4. Is this the proper syntax?
$(document).ready(function() {
var table = $('#example').DataTable(
{
scrollY: "300px",
scrollX: true,
scrollCollapse: true,
paging: false
},
{
"columnDefs": [
{ "orderData": 0, "targets": 0 },
{ "orderData": [1, 4], "targets": 1 },
]
}
);
new $.fn.dataTable.FixedColumns( table,
{
"leftColumns": 1
});
} );
This discussion has been closed.
Answers
Yes
Not quite, Only pass one object into DataTables:
Allan
Thanks! I'm just getting started with DataTables.