https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35284
Lari Strand <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #37 from Lari Strand <[email protected]> --- I resolved the issue (in 22.11 without these patches) by setting a timeout in koha-tmpl/intranet-tmpl/prog/js/datatables.js that waits after typing has finished to the column filter field before filtering happens. This way we do not need to limit the amount of events fired (throttling) and the system feels responsive at all times, even with heavy filtering going on and lots of typing to the filter field. function delay(callback, ms) { var timer = 0; return function() { var context = this, args = arguments; clearTimeout(timer); timer = setTimeout(function () { callback.apply(context, args); }, ms || 0); }; } $( input_type, this ).on( 'keyup change', (delay(function () { if ( table_dt.column(i).search() !== this.value ) { if ( input_type == "input" ) { table_dt .column(i) .search( this.value ) .draw(); } else { table_dt .column(i) .search( this.value.length ? '^'+this.value+'$' : '', true, false ) .draw(); } } },500 ))); Something among those lines. 500ms at the bottom is a hardcoded wait time until the keyup or change event fires for which the value could be fetched from somewhere else is hard coding is an issue. Could this be a suitable/better approach still for filtering columns? I'm also wondering why we haven't updated the version of the Datatables libraries. Should it be updated? We have 4 years of commits missing. 1.13.8 seemed to work out of the box on my dev install of 22.11. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
