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:
parent
6b605936f7
commit
23fc3858d9
@ -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();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user