Merge pull request #293 from hawk-ip/hawk-ip-patch-fnSetFilteringDelay

Fix - plug-in: fnSetFilteringDelay when filtering disabled
pull/295/head
Allan Jardine 8 years ago committed by GitHub
commit d9f69f081e

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

Loading…
Cancel
Save