From 6a34312924942d52b5f66be2d4d84fac347c4625 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Sat, 26 Oct 2024 21:25:38 +0200 Subject: [PATCH] Fix empty jobs and job report tables if used search filters --- Web/Pages/JobList.page | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Web/Pages/JobList.page b/Web/Pages/JobList.page index 2a5e563..cda76b5 100644 --- a/Web/Pages/JobList.page +++ b/Web/Pages/JobList.page @@ -647,7 +647,7 @@ var oJobHistoryList = { this.table.columns().draw(); }, set_filters: function(type) { - const ptype = get_url_param('type');; + const ptype = get_url_param('type'); type = type || ptype; var search_func; switch (type) { @@ -685,7 +685,13 @@ var oJobHistoryList = { break; } if (search_func) { - $.fn.dataTable.ext.search.push(search_func); + const search_func_all = (settings, search_data, index, row_data, counter) => { + if (settings.nTable.id !== this.ids.job_list) { + return true; + } + return search_func(settings, search_data, index, row_data, counter); + }; + $.fn.dataTable.ext.search.push(search_func_all); if (ptype) { // if type parameter passed in the URL query string, reset all filters (@see search('')) this.table.columns().search('').draw();