From cea06994dec0b76f8fdc93a54617402969446849 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 24 Apr 2024 14:59:46 +0200 Subject: [PATCH] fixes the bug with the columnDefault tooltips that was inside the TableWidget.js file --- .../approveAnrechnungUebersichtData.php | 7 +------ .../reviewAnrechnungUebersichtData.php | 4 ---- public/js/TableWidget.js | 17 +++++++++-------- .../anrechnung/approveAnrechnungUebersicht.js | 14 +++++--------- .../anrechnung/reviewAnrechnungUebersicht.js | 2 +- 5 files changed, 16 insertions(+), 28 deletions(-) diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index c017e2387..419dc6331 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -221,12 +221,7 @@ $filterWidgetArray = array( }, columnDefaults:{ - - //columnDefaults tooltip did not work - - tooltip:function(e, cell, onRendered){ - return func_tooltips(cell); - }, + tooltip:func_tooltips, headerFilterPlaceholder: " ", } diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php index 2b7701bca..1bd5c667f 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php @@ -167,12 +167,8 @@ $filterWidgetArray = array( return func_selectableCheck(row); }, columnDefaults:{ - - //columnDefaults tooltip did not work - tooltip:func_tooltips, headerFilterPlaceholder: " ", - } }', // tabulator properties diff --git a/public/js/TableWidget.js b/public/js/TableWidget.js index 6b96cd85e..b45ba9988 100644 --- a/public/js/TableWidget.js +++ b/public/js/TableWidget.js @@ -551,14 +551,15 @@ var FHC_TableWidget = { // ...if there are data to be displayed... if (data.hasOwnProperty("dataset") && $.isArray(data.dataset)) { if (options == null) options = {}; - options.columnDefaults = { - // set header tooltip with column title - //! the old keyword is tooltipsHeader, the new keyword for the option is headerTooltip - headerTooltip: - typeof options.columnDefaults?.tooltipsHeader == "undefined" - ? true - : options.columnDefaults?.tooltipsHeader, - }; + options.columnDefaults={ + ...(options.columnDefaults||{}), + headerTooltip: + typeof options.columnDefaults?.tooltipsHeader == "undefined" + ? true + : options.columnDefaults?.tooltipsHeader, + }; + + options.columns = arrayTabulatorColumns; options.data = data.dataset; options.persistence = diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 2d68a310b..36a35a68d 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -184,8 +184,6 @@ var format_ectsSumBisherUndNeu = function (cell, formatterParams, onRendered) { ); }; - - // Formats row selectable/unselectable function func_selectableCheck(row) { let status_kurzbz = row.getData().status_kurzbz; @@ -220,16 +218,14 @@ function func_rowSelectionChanged(data, rows, tabulatorInstance) { } // Returns tooltip -function func_tooltips() { +function func_tooltips(e,cell,onRendered) { //e - mouseover event //cell - cell component //onRendered - onRendered callback registration function - console.log("here"); - // console.log("TOOLTIP DEBUG",cell); - // // Return tooltip if row is unselectable - // if (true || !func_selectableCheck(cell.getRow())){ - // return FHC_PhrasesLib.t("ui", "nichtSelektierbarAufgrundVon") + 'Status'; - // } + // Return tooltip if row is unselectable + if (!func_selectableCheck(cell.getRow())) { + return FHC_PhrasesLib.t("ui", "nichtSelektierbarAufgrundVon") + "Status"; + } } // Formats empfehlung_anrechnung diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js index d0004ba3a..277e3ad3e 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -125,7 +125,7 @@ function func_tooltips(e, cell, onRendered) { //e - mouseover event //cell - cell component //onRendered - onRendered callback registration functionfunction - console.log("this is a tooltip"); + // Return tooltip if row is unselectable if (!func_selectableCheck(cell.getRow())) { return FHC_PhrasesLib.t("ui", "nichtSelektierbarAufgrundVon") + "Status";