Bug 35284: Add throttling to column filters
Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
8738dcd988
commit
5220dd6004
1 changed files with 8 additions and 4 deletions
|
@ -911,13 +911,17 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) {
|
|||
}
|
||||
}
|
||||
|
||||
var search = $.fn.dataTable.util.throttle( function ( i, val ) {
|
||||
table_dt
|
||||
.column( i )
|
||||
.search( val )
|
||||
.draw();
|
||||
}, 1000 );
|
||||
|
||||
$( input_type, this ).on( 'keyup change', function () {
|
||||
if ( table_dt.column(i).search() !== this.value ) {
|
||||
if ( input_type == "input" ) {
|
||||
table_dt
|
||||
.column(i)
|
||||
.search( this.value )
|
||||
.draw();
|
||||
search(i, this.value)
|
||||
} else {
|
||||
table_dt
|
||||
.column(i)
|
||||
|
|
Loading…
Reference in a new issue