Multi-column Date sorting issue.

Multi-column Date sorting issue.

porpdogporpdog Posts: 1Questions: 0Answers: 0
edited January 2011 in Bug reports
We have an issue where we have a table with 7 columns and if we sort on multiple columns in IE 7 where the first sort column is a string and the second sort column is a Date, the paging stops working. In FireFox we get the error: 'q[d + ("-" + k[f][1])]' is not a function. Here is the code:
[code]
$(document).ready(function () {

jQuery.fn.dataTableExt.oSort['us_date-asc'] = function (a, b) {
var x = new Date(a),
y = new Date(b);
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};

jQuery.fn.dataTableExt.oSort['us_date-desc'] = function (a, b) {
var x = new Date(a),
y = new Date(b);
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};

$('.tbl').dataTable({
'bFilter': false,
'bSort': true,
'bLengthChange': false,
'sPaginationType': 'two_button',
'bRetrieve': true,
'iDisplayLength': 25,
'aaSorting': [[6, 'asc'], [0, 'asc']],
'aoColumns': [{ "sType": 'us_date-asc' }, null, null, null, null, null, null]
//We also tried using this: 'aoColumns': [{ "sType": "date" }, null, null, null, null, null, null]


});

});
[/code]
This discussion has been closed.