From 664bd996ff5219f29cdfcfeb7dea48225312cc6e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 11 Feb 2025 10:07:40 +0100 Subject: [PATCH] Bug 39011: Apply the pre-process to column filters --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 8448800be42..68e8c03a492 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -492,9 +492,10 @@ function _dt_default_ajax (params){ [col.related + '.' + col.relatedSearchOn]: query_term }; } else if (coded_datatype && coded_datatype.length > 1) { - if (global_search.length){ + if (global_search.length || value.length){ coded_datatype = coded_datatype[1]; - const regex = new RegExp(`^${global_search}`, 'i'); + const search_value = value.length ? value : global_search; + const regex = new RegExp(`^${search_value}`, 'i'); if ( coded_values && coded_values.hasOwnProperty(coded_datatype) ) { let codes = [...coded_values[coded_datatype].entries()] .filter(([label]) => regex.test(label)) -- 2.34.1