From fe3da95290698a57425c8d54ff05ed91c29b3683 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 7 Mar 2023 15:02:25 +0100 Subject: [PATCH] Bug 33066: Reintroduce column filters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Pedro Amorim Signed-off-by: Agustín Moyano Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 13 ++++-- .../js/vue/components/ERM/AgreementsList.vue | 41 ++++++++++--------- .../prog/js/vue/components/KohaTable.vue | 6 ++- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 689fc4307c..bcf308c56c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -822,7 +822,7 @@ function _dt_on_visibility(add_filters, table_node, table_dt){ } } -function _dt_add_filters(table_node, table_dt) { +function _dt_add_filters(table_node, table_dt, filters_options = {}) { $(table_node).find('thead tr').clone().appendTo( $(table_node).find('thead') ); $(table_node).find('thead tr:eq(1) th').each( function (i) { @@ -831,14 +831,19 @@ function _dt_add_filters(table_node, table_dt) { $(this).data('th-id', i); if ( is_searchable ) { let input_type = 'input'; - if ( $(this).data('filter') ) { + if ( $(this).data('filter') || filters_options.hasOwnProperty(i)) { input_type = 'select' let filter_type = $(this).data('filter'); - var existing_search = table_dt.column(i).search(); + let existing_search = table_dt.column(i).search(); let select = $('