diff --git a/api/fnSetFilteringDelay.js b/api/fnSetFilteringDelay.js index 4dac6a6..334df00 100644 --- a/api/fnSetFilteringDelay.js +++ b/api/fnSetFilteringDelay.js @@ -29,25 +29,28 @@ jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) } this.each( function ( i ) { - $.fn.dataTableExt.iApiIndex = i; - var - oTimerId = null, - sPreviousSearch = null, - anControl = $( 'input', _that.fnSettings().aanFeatures.f ); - - anControl.unbind( 'keyup search input' ).bind( 'keyup search input', function() { - - if (sPreviousSearch === null || sPreviousSearch != anControl.val()) { - window.clearTimeout(oTimerId); - sPreviousSearch = anControl.val(); - oTimerId = window.setTimeout(function() { - $.fn.dataTableExt.iApiIndex = i; - _that.fnFilter( anControl.val() ); - }, iDelay); - } - }); - - return this; + if ( typeof _that.fnSettings().aanFeatures.f !== 'undefined' ) + { + $.fn.dataTableExt.iApiIndex = i; + var + oTimerId = null, + sPreviousSearch = null, + anControl = $( 'input', _that.fnSettings().aanFeatures.f ); + + anControl.unbind( 'keyup search input' ).bind( 'keyup search input', function() { + + if (sPreviousSearch === null || sPreviousSearch != anControl.val()) { + window.clearTimeout(oTimerId); + sPreviousSearch = anControl.val(); + oTimerId = window.setTimeout(function() { + $.fn.dataTableExt.iApiIndex = i; + _that.fnFilter( anControl.val() ); + }, iDelay); + } + }); + + return this; + } } ); return this; };