From 1d9a6a8969de9d1e81a1b1bb1ce6a441138d87b0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Mar 2022 16:20:06 +0100 Subject: [PATCH] Bug 32030: ERM - Vue - Datatables fix Same as from bug 30225 and bug 30160 This really needs to be on its own bug... Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 183b04b927..2962b52e44 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -517,10 +517,6 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { $.fn.kohaTable = function(options, table_settings, add_filters, default_filters) { var settings = null; - if ( add_filters ) { - $(this).find('thead tr').clone(true).appendTo( $(this).find('thead') ); - } - if(options) { if(!options.criteria || ['contains', 'starts_with', 'ends_with', 'exact'].indexOf(options.criteria.toLowerCase()) === -1) options.criteria = 'contains'; options.criteria = options.criteria.toLowerCase(); @@ -852,8 +848,12 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { if ( add_filters ) { var table_dt = table.DataTable(); + + $(this).find('thead tr').clone(true).appendTo( $(this).find('thead') ); + $(this).find('thead tr:eq(1) th').each( function (i) { var is_searchable = table_dt.settings()[0].aoColumns[i].bSearchable; + $(this).removeClass('sorting'); if ( is_searchable ) { let input_type = 'input'; if ( $(this).data('filter') ) { -- 2.20.1