From df057faa8fbedae7c41f8f0b9b6d694d7da7c290 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Dec 2019 15:45:34 +0100 Subject: [PATCH] Added default text 'Keine Daten vorhanden' for empty tables Before the tabulator sometimes looked kind of 'undone', when no data was loaded. Now a nice message is displayed if the table is empty. --- .../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/lehre/lehrauftrag/acceptLehrauftrag.js | 6 ++++++ public/js/lehre/lehrauftrag/approveLehrauftrag.js | 7 +++++++ public/js/lehre/lehrauftrag/orderLehrauftrag.js | 7 +++++++ 7 files changed, 24 insertions(+) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php index 70ab7247c..9f96a0922 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftragData.php @@ -318,6 +318,7 @@ $filterWidgetArray = array( layout: "fitColumns", // fit columns to width of table responsiveLayout: "hide", // hide columns that dont fit on the table 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 befff5d5a..c9793fda7 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -329,6 +329,7 @@ $filterWidgetArray = array( layout: "fitColumns", // fit columns to width of table responsiveLayout: "hide", // hide columns that dont fit on the table 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 ec286ced2..04d314636 100644 --- a/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/cancelledLehrauftragData.php @@ -67,6 +67,7 @@ $tableWidgetArray = array( layout: "fitColumns", // fit columns to width of table responsiveLayout: "hide", // hide columns that dont fit on the table 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 3469a7c76..2eed6ae63 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -363,6 +363,7 @@ $filterWidgetArray = array( layout:"fitColumns", // fit columns to width of table responsiveLayout:"hide", // hide columns that dont fit on the table 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/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index 3be0bcb2b..03c72e2f2 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -81,6 +81,12 @@ function hf_filterStringnumberWithOperator(headerValue, rowValue, rowData){ // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- +// 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 da3697adf..94e6af473 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -94,6 +94,13 @@ function func_initialFilter(){ // ----------------------------------------------------------------------------------------------------------------- // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- + +// 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 d27da0e4e..4e58272e5 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -99,6 +99,13 @@ function func_dataLoaded(data, table){ // ----------------------------------------------------------------------------------------------------------------- // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- + +// 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;