From 6897ccdd6b4973e260ebbb355c0f751dc0dc7f10 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 30 Jan 2020 12:43:50 +0100 Subject: [PATCH] Moved empty table placeholder text to TableWidget Now this is a standard behaviour of TableWidget. --- .../views/lehre/lehrauftrag/acceptLehrauftragData.php | 1 - .../views/lehre/lehrauftrag/approveLehrauftragData.php | 1 - .../views/lehre/lehrauftrag/cancelledLehrauftragData.php | 1 - .../views/lehre/lehrauftrag/orderLehrauftragData.php | 1 - public/js/TableWidget.js | 8 ++++++++ public/js/lehre/lehrauftrag/acceptLehrauftrag.js | 6 ------ public/js/lehre/lehrauftrag/approveLehrauftrag.js | 6 ------ public/js/lehre/lehrauftrag/orderLehrauftrag.js | 6 ------ 8 files changed, 8 insertions(+), 22 deletions(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index 3211e86a9..3fa2c603c 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -332,7 +332,6 @@ $filterWidgetArray = array( persistenceID: "acceptLehrauftrag", // TableWidget unique id to store persistence data seperately for multiple tables autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated movableColumns: true, // allows changing column - placeholder: func_placeholder(), headerFilterPlaceholder: " ", index: "row_index", // assign specific column as unique id (important for row indexing) selectable: true, // allow row selection diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 4ad03e138..7cc5bd533 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -344,7 +344,6 @@ $filterWidgetArray = array( persistenceID: "approveLehrauftrag", // TableWidget unique id to store persistence data seperately for multiple tables autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated movableColumns: true, // allows changing column - placeholder: func_placeholder(), headerFilterPlaceholder: " ", groupBy:"lehrveranstaltung_id", groupToggleElement:"header", //toggle group on click anywhere in the group header diff --git a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php index 2dbecbb69..cbf7d8b55 100644 --- a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php @@ -70,7 +70,6 @@ $tableWidgetArray = array( persistenceID: "cancelledLehrauftrag", // TableWidget unique id to store persistence data seperately for multiple tables autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated movableColumns: true, // allows changing column - placeholder: func_placeholder(), rowFormatter:function(row){ func_rowFormatter(row); }, diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 5576e7886..f4a122deb 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -379,7 +379,6 @@ $filterWidgetArray = array( persistenceID: "orderLehrauftrag", // TableWidget unique id to store persistence data seperately for multiple tables autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated movableColumns: true, // allows changing column order - placeholder: func_placeholder(), // shown on empty table (no data) headerFilterPlaceholder: " ", groupBy:"lehrveranstaltung_id", groupToggleElement:"header", //toggle group on click anywhere in the group header diff --git a/public/js/TableWidget.js b/public/js/TableWidget.js index 7c1b01b93..7b914cc60 100644 --- a/public/js/TableWidget.js +++ b/public/js/TableWidget.js @@ -523,6 +523,7 @@ var FHC_TableWidget = { options.columns = arrayTabulatorColumns; options.data = data.dataset; options.tooltipsHeader = true; // set header tooltip with column title + options.placeholder = _func_placeholder(); // display text when table is empty options.rowSelectionChanged = function(data, rows){ _func_rowSelectionChanged(data, rows); }; @@ -718,6 +719,13 @@ function _func_columnVisibilityChanged(column, visible){ table.redraw(); } +/* + * Displays text when table is empty + */ +function _func_placeholder(){ + return "

Keine Daten vorhanden.

"; +} + // Returns TableWidget Header HTML (download-, setting button...) function _renderTabulatorHeaderHTML(tableWidgetDiv){ diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index c3d89ac52..341a325fc 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -98,12 +98,6 @@ function func_height(table){ return $(window).height() * 0.50; } -// Displays text when table is empty -function func_placeholder() -{ - return "

Keine Daten vorhanden.

"; -} - // Formats the rows function func_rowFormatter(row){ var bestellt = row.getData().bestellt; diff --git a/public/js/lehre/lehrauftrag/approveLehrauftrag.js b/public/js/lehre/lehrauftrag/approveLehrauftrag.js index 29e2d9651..7326a95c1 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -111,12 +111,6 @@ function func_height(table){ return $(window).height() * 0.50; } -// Displays text when table is empty -function func_placeholder() -{ - return "

Keine Daten vorhanden.

"; -} - // Formats the group header function func_groupHeader(data){ return data[0].lv_bezeichnung + "  " + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung; diff --git a/public/js/lehre/lehrauftrag/orderLehrauftrag.js b/public/js/lehre/lehrauftrag/orderLehrauftrag.js index 6471d988f..379a02b6a 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -116,12 +116,6 @@ function func_height(table){ return $(window).height() * 0.50; } -// Displays text when table is empty -function func_placeholder() -{ - return "

Keine Daten vorhanden.

"; -} - // Formats the group header function func_groupHeader(data) { return data[0].lv_bezeichnung + "  " + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung;