Wrong sorting explorer 8

Wrong sorting explorer 8

diegofiodiegofio Posts: 3Questions: 0Answers: 0
edited May 2012 in Plug-ins
Hi,

i've written a custom algorithm for sorting. it sorts data like these:
progressive number/year

ie:
6/2013
6/2016
18/2016
where
6/2013 < 6/2016 < 18/2016

This is the code (the output is reversed for dec):

[code]jQuery.fn.dataTableExt.oSort['numberSlashYear-asc'] = function(a,b) {
var numberA = parseInt(a.split('/')[0]);
var yearA = parseInt(a.split('/')[1]);
var numberB = parseInt(b.split('/')[0]);
var yearB = parseInt(b.split('/')[1]);

if (yearA < yearB)
return 0;
else
{
if (yearA > yearB)
return 1;
else
{
if (numberA <= numberB)
return 0;
else
return 1;
}
}
return 0;
};
[/code]

i debugged it and it always returns correct outputs both in IE and FF, but in IE the data in the table aren't sorted, despite the algorithm works properly.

The definition of my datatable:

[code]
var letteraIntentoTable = $('#lettera_intento_table').dataTable( {
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 4 ] }
],
"aaSorting": [[0, 'asc']],
"sDom": 'R<"H"lfr>t<"F"ip>',
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {"sUrl": "${it_IT_url}"},
"bAutoWidth": false,
"aoColumns" : [
{ sType: 'numberSlashYear' },
null,
null,
null,
null
]
} );
[/code]

debug code: ahefeg

thanks in advance
Diego
This discussion has been closed.