Permalink
Browse files

Fix: When sorting numerically, '-' and '' should be treated as -Infin…

…ity rather than as 0, since negative numbers could also be used int he column and this would split the numbers.
  • Loading branch information...
DataTables committed Oct 30, 2012
1 parent ec0556b commit 3ac3cedf535b5ee2fc5f6179ed50143878f6cc31
Showing with 3 additions and 5 deletions.
  1. +1 −3 examples/basic_init/zero_config.html
  2. +1 −1 media/js/jquery.dataTables.js
  3. +1 −1 media/src/ext/ext.sorting.js
@@ -13,9 +13,7 @@
<script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
- $('#example').dataTable( {
- bSort: false
- } );
+ $('#example').dataTable();
} );
</script>
</head>
@@ -11991,7 +11991,7 @@
*/
"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 )
{
- return (a=="-" || a==="") ? 0 : a*1;
+ return (a=="-" || a==="") ? -Infinity : a*1;
}
} );

0 comments on commit 3ac3ced

Please sign in to comment.