diff --git a/media/src/api/api.search.js b/media/src/api/api.search.js new file mode 100644 index 00000000..edd2431d --- /dev/null +++ b/media/src/api/api.search.js @@ -0,0 +1,43 @@ + + +(/** @lends */function() { + +var _api = DataTable.Api; + + +_api.register( 'search()', function ( input, caseInsen, regex, smart ) { + return this.iterator( 'table', function ( settings ) { + if ( ! settings.oFeatures.bFilter ) { + return; + } + + _fnFilterComplete( settings, { + "sSearch": input+"", + "bRegex": regex === null ? false : regex, + "bSmart": smart === null ? true : smart, + "bCaseInsensitive": caseInsen === null ? true : caseInsen + }, 1 ); + } ); +} ); + + +_api.register( 'columns().search()', function ( input, caseInsen, regex, smart ) { + return this.iterator( 'column', function ( settings, column ) { + if ( ! settings.oFeatures.bFilter ) { + return; + } + + $.extend( settings.aoPreSearchCols[ column ], { + "sSearch": input+"", + "bRegex": regex === null ? false : regex, + "bSmart": smart === null ? true : smart, + "bCaseInsensitive": caseInsen === null ? true : caseInsen + } ); + + _fnFilterComplete( settings, settings.oPreviousSearch, 1 ); + } ); +} ); + + +}()); + diff --git a/media/src/core/core.filter.js b/media/src/core/core.filter.js index cbd24eec..8fd5acff 100644 --- a/media/src/core/core.filter.js +++ b/media/src/core/core.filter.js @@ -34,14 +34,6 @@ function _fnFeatureHtmlFilter ( oSettings ) var n = oSettings.aanFeatures.f; var val = this.value==="" ? "" : this.value; // mental IE8 fix :-( - for ( var i=0, iLen=n.length ; i