mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-19 12:52:11 +01:00
Fix: When sorting numerically, '-' and '' should be treated as -Infinity rather than as 0, since negative numbers could also be used int he column and this would split the numbers.
This commit is contained in:
parent
ec0556b4f6
commit
3ac3cedf53
@ -13,9 +13,7 @@
|
|||||||
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
|
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#example').dataTable( {
|
$('#example').dataTable();
|
||||||
bSort: false
|
|
||||||
} );
|
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
2
media/js/jquery.dataTables.js
vendored
2
media/js/jquery.dataTables.js
vendored
@ -11991,7 +11991,7 @@
|
|||||||
*/
|
*/
|
||||||
"numeric-pre": function ( a )
|
"numeric-pre": function ( a )
|
||||||
{
|
{
|
||||||
return (a=="-" || a==="") ? 0 : a*1;
|
return (a=="-" || a==="") ? -Infinity : a*1;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -56,6 +56,6 @@ $.extend( DataTable.ext.oSort, {
|
|||||||
*/
|
*/
|
||||||
"numeric-pre": function ( a )
|
"numeric-pre": function ( a )
|
||||||
{
|
{
|
||||||
return (a=="-" || a==="") ? 0 : a*1;
|
return (a=="-" || a==="") ? -Infinity : a*1;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user