asSorting confusion
asSorting confusion
I am reading through aoColumnDefs, aoColumns section and got confused
[code]
/* Using aoColumnDefs */
$(document).ready(function() {
$('#example').dataTable( {
"aoColumnDefs": [
{ "asSorting": [ "asc" ], "aTargets": [ 1 ] },
{ "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
{ "asSorting": [ "desc" ], "aTargets": [ 3 ] }
]
} );
} );
[/code]
I can't quite understand what this means...
[code]
{ "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
[/code]
I have a bug on a table that uses the server side wherein date sorting works fine in the date column, but when I sort other columns, the date is not in desc order...like the multicolumn sorting is not working. So I am trying to understand what step I missed by understanding more about aoColumns, aoColumnDef
Here is my code, where 2 is the date column, I've set "aaSorting": [[2, "desc"]].
[code]
columns = $.employees.getTableColumnDefs( );
employees_tbl =
$('#employees_tbl').dataTable({
"bJQueryUI" : true,
"aaSorting": [[2, "desc"]],
"aLengthMenu": [[15, 30, 45, 100], [15, 30, 45, 100]],
"iDisplayLength": 15,
"sPaginationType": "full_numbers",
"aoColumnDefs": columns,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "ajax/employees/list.php"
});
[/code]
Pardon me.
[code]
/* Using aoColumnDefs */
$(document).ready(function() {
$('#example').dataTable( {
"aoColumnDefs": [
{ "asSorting": [ "asc" ], "aTargets": [ 1 ] },
{ "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
{ "asSorting": [ "desc" ], "aTargets": [ 3 ] }
]
} );
} );
[/code]
I can't quite understand what this means...
[code]
{ "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
[/code]
I have a bug on a table that uses the server side wherein date sorting works fine in the date column, but when I sort other columns, the date is not in desc order...like the multicolumn sorting is not working. So I am trying to understand what step I missed by understanding more about aoColumns, aoColumnDef
Here is my code, where 2 is the date column, I've set "aaSorting": [[2, "desc"]].
[code]
columns = $.employees.getTableColumnDefs( );
employees_tbl =
$('#employees_tbl').dataTable({
"bJQueryUI" : true,
"aaSorting": [[2, "desc"]],
"aLengthMenu": [[15, 30, 45, 100], [15, 30, 45, 100]],
"iDisplayLength": 15,
"sPaginationType": "full_numbers",
"aoColumnDefs": columns,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "ajax/employees/list.php"
});
[/code]
Pardon me.
This discussion has been closed.