From 52251733bc5ff81573e581ebc2ef12e7c3b4ee92 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 Nov 2024 14:16:44 +0100 Subject: [PATCH] Bug 38391: Redraw the filters row on table redraw We used to adjust the filters row when the column visibility changed. It was working, but at the initialization of the table this event if fired once per columns. On the items table it means 36x. When a filtering/sorting, the draw event is triggered once, but the column-visibility.dt is called 36x Try with and without this patch and compare the delay between the query is received and the page is redrawn. --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 1a0a893c5ab..82c3cd4fbee 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1143,7 +1143,7 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ _dt_add_filters(this, table_dt, filters_options); } - table_dt.on("column-visibility.dt", function(){ + table_dt.on("draw", function(){ if ( add_filters ) { _dt_add_filters(this, table_dt, filters_options); } -- 2.34.1