Skip to content

Commit

Permalink
Fix: If filtering data is null, undefined or NaN it is not included i…
Browse files Browse the repository at this point in the history
…n the filter
  • Loading branch information
Allan Jardine committed Jul 15, 2014
1 parent c444c66 commit cd5a872
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions js/core/core.filter.js
Expand Up @@ -332,22 +332,24 @@ function _fnFilterData ( settings )
cellData = '';
}

// If it looks like there is an HTML entity in the string,
// attempt to decode it so sorting works as expected. Note that
// we could use a single line of jQuery to do this, but the DOM
// method used here is much faster http://jsperf.com/html-decode
if ( cellData.indexOf && cellData.indexOf('&') !== -1 ) {
__filter_div.innerHTML = cellData;
cellData = __filter_div_textContent ?
__filter_div.textContent :
__filter_div.innerText;
if ( cellData ) {
// If it looks like there is an HTML entity in the string,
// attempt to decode it so sorting works as expected. Note that
// we could use a single line of jQuery to do this, but the DOM
// method used here is much faster http://jsperf.com/html-decode
if ( cellData.indexOf && cellData.indexOf('&') !== -1 ) {
__filter_div.innerHTML = cellData;
cellData = __filter_div_textContent ?
__filter_div.textContent :
__filter_div.innerText;
}

if ( cellData.replace ) {
cellData = cellData.replace(/[\r\n]/g, '');
}

filterData.push( cellData );
}

if ( cellData.replace ) {
cellData = cellData.replace(/[\r\n]/g, '');
}

filterData.push( cellData );
}

row._aFilterData = filterData;
Expand Down

0 comments on commit cd5a872

Please sign in to comment.