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.
This commit is contained in:
Cris
2019-12-18 15:45:34 +01:00
committed by hainberg
parent ff9aa5c48a
commit df057faa8f
7 changed files with 24 additions and 0 deletions
@@ -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
@@ -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
@@ -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);
},
@@ -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
@@ -81,6 +81,12 @@ function hf_filterStringnumberWithOperator(headerValue, rowValue, rowData){
// Tabulator table format functions
// -----------------------------------------------------------------------------------------------------------------
// Displays text when table is empty
function func_placeholder()
{
return "<h4>Keine Daten vorhanden.</h4>";
}
// Formats the rows
function func_rowFormatter(row){
var bestellt = row.getData().bestellt;
@@ -94,6 +94,13 @@ function func_initialFilter(){
// -----------------------------------------------------------------------------------------------------------------
// Tabulator table format functions
// -----------------------------------------------------------------------------------------------------------------
// Displays text when table is empty
function func_placeholder()
{
return "<h4>Keine Daten vorhanden.</h4>";
}
// Formats the group header
function func_groupHeader(data){
return data[0].lv_bezeichnung + "&nbsp;&nbsp;" + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung;
@@ -99,6 +99,13 @@ function func_dataLoaded(data, table){
// -----------------------------------------------------------------------------------------------------------------
// Tabulator table format functions
// -----------------------------------------------------------------------------------------------------------------
// Displays text when table is empty
function func_placeholder()
{
return "<h4>Keine Daten vorhanden.</h4>";
}
// Formats the group header
function func_groupHeader(data) {
return data[0].lv_bezeichnung + "&nbsp;&nbsp;" + ' ( LV-ID: ' + data[0].lehrveranstaltung_id + ' )'; // change name to lehrveranstaltung;