diff --git a/media/src/api/api.search.js b/media/src/api/api.search.js index 721965e2..a9c5a35d 100644 --- a/media/src/api/api.search.js +++ b/media/src/api/api.search.js @@ -3,20 +3,23 @@ (/** @lends */function() { var _api = DataTable.Api; +var _null_or_undefined = function ( param ) { + return param === null || param === undefined; +}; -_api.register( 'search()', function ( input, caseInsen, regex, smart ) { +_api.register( 'search()', function ( input, regex, smart, caseInsen ) { return this.iterator( 'table', function ( settings ) { if ( ! settings.oFeatures.bFilter ) { return; } - _fnFilterComplete( settings, { + _fnFilterComplete( settings, $.extend( {}, settings.oPreviousSearch, { "sSearch": input+"", "bRegex": regex === null ? false : regex, "bSmart": smart === null ? true : smart, "bCaseInsensitive": caseInsen === null ? true : caseInsen - }, 1 ); + } ), 1 ); } ); } ); @@ -24,7 +27,7 @@ _api.register( 'search()', function ( input, caseInsen, regex, smart ) { _api.register( [ 'columns().search()', 'column().search()' -], function ( input, caseInsen, regex, smart ) { +], function ( input, regex, smart, caseInsen ) { return this.iterator( 'column', function ( settings, column ) { if ( ! settings.oFeatures.bFilter ) { return;