mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Merge pull request #108 from timtucker/patch-21
Fix: Update string sorting to correctly sort undefined values.
This commit is contained in:
commit
8b6e3fe264
@ -1,12 +1,16 @@
|
|||||||
|
|
||||||
$.extend( DataTable.ext.oSort, {
|
$.extend( DataTable.ext.oSort, {
|
||||||
/*
|
/*
|
||||||
* text sorting
|
* text sorting
|
||||||
*/
|
*/
|
||||||
"string-pre": function ( a )
|
"string-pre": function ( a )
|
||||||
{
|
{
|
||||||
if ( typeof a != 'string' ) {
|
if ( typeof a != 'string' )
|
||||||
a = (a !== null && a.toString) ? a.toString() : '';
|
{
|
||||||
|
if (a === null || a === undefined || !a.toString)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
a = a.toString();
|
||||||
}
|
}
|
||||||
return a.toLowerCase();
|
return a.toLowerCase();
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user