1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-11-29 11:24:10 +01:00

Fix: Backwards compatiblity for the old bEscapeRegex option - which has

now been replaced with the more sensible bRegex option
This commit is contained in:
Allan Jardine 2014-05-01 11:44:13 +01:00
parent 0406a47e6a
commit 06b1195376
2 changed files with 7 additions and 3 deletions

View File

@ -1 +1 @@
e3be6800b2a627ed293acb71380ef15d18f47b91
9b187f5327f95ae6eaa21ac9d2f2f2a9e3c91b21

View File

@ -2708,6 +2708,10 @@
oPrevSearch.bSmart = oFilter.bSmart;
oPrevSearch.bCaseInsensitive = oFilter.bCaseInsensitive;
};
var fnRegex = function ( o ) {
// Backwards compatibility with the bEscapeRegex option
return o.bEscapeRegex !== undefined ? !o.bEscapeRegex : o.bRegex;
};
// Resolve any column types that are unknown due to addition or invalidation
// @todo As per sort - can this be moved into an event handler?
@ -2717,13 +2721,13 @@
if ( _fnDataSource( oSettings ) != 'ssp' )
{
/* Global filter */
_fnFilter( oSettings, oInput.sSearch, iForce, oInput.bRegex, oInput.bSmart, oInput.bCaseInsensitive );
_fnFilter( oSettings, oInput.sSearch, iForce, fnRegex(oInput), oInput.bSmart, oInput.bCaseInsensitive );
fnSaveFilter( oInput );
/* Now do the individual column filter */
for ( var i=0 ; i<aoPrevSearch.length ; i++ )
{
_fnFilterColumn( oSettings, aoPrevSearch[i].sSearch, i, aoPrevSearch[i].bRegex,
_fnFilterColumn( oSettings, aoPrevSearch[i].sSearch, i, fnRegex(aoPrevSearch[i]),
aoPrevSearch[i].bSmart, aoPrevSearch[i].bCaseInsensitive );
}