jQuery datatable - Object doesn't support property or method 'numeric-DESC'
I am using the jQuery datatable, and keep getting the error with message "Object doesn't support property or method 'numeric-DESC'"
The following are my codes:
var oTable = $('#tbSns').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bStateSave": true,
"iDisplayLength": 10,
"aLengthMe开发者_开发百科nu": [[25, 50, 75, -1], [25, 50, 75, "All"]],
"aaSorting": [[1,'DESC']]
});
Guess something wrong with aaSorting, however, still tring to find out
A bit of a guess, but I'd say that "DESC"
is case sensitive, and should be "desc"
.
From the plugin's website:
"The aaSorting parameter is an array of arrays where the first value is the column to sort on, and the second is 'asc' or 'desc' as required (it is a double array for multi-column sorting)."
So:
var oTable = $('#tbSns').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bStateSave": true,
"iDisplayLength": 10,
"aLengthMenu": [[25, 50, 75, -1], [25, 50, 75, "All"]],
"aaSorting": [[1,'desc']] // <-- lowercase 'desc'
});
精彩评论