|
|
|
@ -12,32 +12,34 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
|
|
|
|
|
var
|
|
|
|
|
_that = this,
|
|
|
|
|
iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
|
|
|
|
|
var _that = this;
|
|
|
|
|
|
|
|
|
|
this.each( function ( i ) {
|
|
|
|
|
$.fn.dataTableExt.iApiIndex = i;
|
|
|
|
|
var
|
|
|
|
|
$this = this,
|
|
|
|
|
oTimerId = null,
|
|
|
|
|
sPreviousSearch = null,
|
|
|
|
|
anControl = $( 'input', _that.fnSettings().aanFeatures.f );
|
|
|
|
|
if ( iDelay === undefined ) {
|
|
|
|
|
iDelay = 250;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
anControl.unbind( 'keyup' ).bind( 'keyup', function() {
|
|
|
|
|
var $$this = $this;
|
|
|
|
|
this.each( function ( i ) {
|
|
|
|
|
$.fn.dataTableExt.iApiIndex = i;
|
|
|
|
|
var
|
|
|
|
|
$this = this,
|
|
|
|
|
oTimerId = null,
|
|
|
|
|
sPreviousSearch = null,
|
|
|
|
|
anControl = $( 'input', _that.fnSettings().aanFeatures.f );
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
anControl.unbind( 'keyup' ).bind( 'keyup', function() {
|
|
|
|
|
var $$this = $this;
|
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
} );
|
|
|
|
|
return this;
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|