1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-30 23:52:11 +01:00

Update media/src/ext/ext.sorting.js

handle undefined values, skip toLowerCase call for empty strings
This commit is contained in:
Tim Tucker 2012-09-30 20:05:09 -03:00
parent 6b605936f7
commit 23fc3858d9

View File

@ -1,12 +1,16 @@
$.extend( DataTable.ext.oSort, {
/*
* text sorting
*/
"string-pre": function ( a )
{
if ( typeof a != 'string' ) {
a = (a !== null && a.toString) ? a.toString() : '';
if ( typeof a != 'string' )
{
if (a === null || a === undefined || !a.toString)
{
return '';
}
a = a.toString();
}
return a.toLowerCase();
},