From 0e6f3a924be7555bd83d3f3a9169770bd226da18 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 25 Aug 2023 10:39:15 +0000 Subject: [PATCH] Bug 34466: Add listener to enable or disable clear filter button on KohaTable.vue --- .../prog/js/vue/components/KohaTable.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue index a5af9e7450..1e5253efe8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue @@ -153,6 +153,20 @@ export default { .columns(this.hidden_ids) .visible(false) + dt.on("search.dt", function (e, settings) { + let searchText = settings.oPreviousSearch.sSearch + let tableId = settings.nTable.id + if (searchText == "") { + $("#" + tableId + "_wrapper") + .find(".dt_button_clear_filter") + .addClass("disabled") + } else { + $("#" + tableId + "_wrapper") + .find(".dt_button_clear_filter") + .removeClass("disabled") + } + }) + if (Object.keys(this.actions).length) { const self = this dt.on("draw", () => { -- 2.30.2