mirror of
https://github.com/DataTables/DataTables.git
synced 2024-12-01 13:24:10 +01:00
Fix: null handling for type detection and filtering methods
- The built in filtering formatters and type detection need to be able to handle just about any data being passed into them. They were tripping up with null data being passed in before.
This commit is contained in:
parent
a798d53d17
commit
5ca931c23b
@ -1 +1 @@
|
||||
ad75f1d054a77eac282189e742c0e5167946ac04
|
||||
bef23129b8047b26e86b2aa75ed213132bd691c0
|
||||
|
24
media/js/jquery.dataTables.js
vendored
24
media/js/jquery.dataTables.js
vendored
@ -13662,6 +13662,10 @@
|
||||
};
|
||||
|
||||
var _htmlNumeric = function ( d, formatted ) {
|
||||
if ( _empty( d ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var html = _isHtml( d );
|
||||
return ! html ?
|
||||
null :
|
||||
@ -13723,17 +13727,21 @@
|
||||
|
||||
$.extend( DataTable.ext.type.filter, {
|
||||
html: function ( data ) {
|
||||
return typeof data === 'string' ?
|
||||
data
|
||||
.replace( __filter_lines, " " )
|
||||
.replace( __filter_html, "" ) :
|
||||
'';
|
||||
return _empty(data) ?
|
||||
'' :
|
||||
typeof data === 'string' ?
|
||||
data
|
||||
.replace( __filter_lines, " " )
|
||||
.replace( __filter_html, "" ) :
|
||||
'';
|
||||
},
|
||||
|
||||
string: function ( data ) {
|
||||
return typeof data === 'string' ?
|
||||
data.replace( __filter_lines, " " ) :
|
||||
data;
|
||||
return _empty(data) ?
|
||||
'' :
|
||||
typeof data === 'string' ?
|
||||
data.replace( __filter_lines, " " ) :
|
||||
data;
|
||||
}
|
||||
} );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user