From 488847984eed33abd77ca2e09529f3aacfc019f8 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 15 Nov 2024 15:19:09 +0100 Subject: [PATCH] change property downloadTitle to titleDownload for Tabulator 5, call tabulator redraw at the end of tableInit callback to ensure renderStart callbacks are run --- public/js/lehre/lehrauftrag/acceptLehrauftrag.js | 3 ++- public/js/lehre/lehrauftrag/approveLehrauftrag.js | 3 ++- public/js/lehre/lehrauftrag/orderLehrauftrag.js | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index b1142ff34..af523fd9f 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -172,7 +172,7 @@ function func_tableBuilt(table) { field: "status", width: 40, hozAlign: "center", - downloadTitle: "Status", + titleDownload: "Status", formatter: status_formatter, tooltip: status_tooltip, }, @@ -477,6 +477,7 @@ $(function () { default: break; } + tabulatorInstance.redraw(true); }); var canPromise = !!window.Promise; diff --git a/public/js/lehre/lehrauftrag/approveLehrauftrag.js b/public/js/lehre/lehrauftrag/approveLehrauftrag.js index 3d8993fc3..4edd749f9 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -216,7 +216,7 @@ function func_tableBuilt(table) { field: "status", width: 40, hozAlign: "center", - downloadTitle: "Status", + titleDownload: "Status", formatter: status_formatter, tooltip: status_tooltip, }, @@ -488,6 +488,7 @@ $(function () { $("#tableWidgetTabulator").tabulator("on", "rowUpdated", (row) => func_rowUpdated(row) ); + $("#tableWidgetTabulator").tabulator("redraw", true); }); // Redraw table on resize to fit tabulators height to windows height diff --git a/public/js/lehre/lehrauftrag/orderLehrauftrag.js b/public/js/lehre/lehrauftrag/orderLehrauftrag.js index 847a863f8..f4bf912c7 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -245,7 +245,7 @@ function func_tableBuilt(table) { field: "status", width: 40, hozAlign: "center", - downloadTitle: "Status", + titleDownload: "Status", formatter: status_formatter, tooltip: status_tooltip, }, @@ -548,10 +548,10 @@ $(function () { func_renderStarted(tabulatorInstance); }); - // event dataLoaded needs to be attached as a callback to the tableBuilt event in tabulator5 - $("#tableWidgetTabulator").tabulator("on", "dataLoaded", (data) => { - func_dataLoaded(data, tabulatorInstance); - }); + // set initial filter + func_dataLoaded(null, tabulatorInstance); + + $("#tableWidgetTabulator").tabulator("redraw", true); }); // Redraw table on resize to fit tabulators height to windows height