1
0
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:
Allan Jardine 2012-10-30 21:05:15 +00:00
parent ec0556b4f6
commit 3ac3cedf53
3 changed files with 3 additions and 5 deletions

View File

@ -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>

View File

@ -11991,7 +11991,7 @@
*/ */
"numeric-pre": function ( a ) "numeric-pre": function ( a )
{ {
return (a=="-" || a==="") ? 0 : a*1; return (a=="-" || a==="") ? -Infinity : a*1;
} }
} ); } );

View File

@ -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;
} }
} ); } );