tabulator5 function changes

This commit is contained in:
SimonGschnell
2024-04-24 10:00:12 +02:00
parent 96b79c8740
commit 7dfe2f1932
13 changed files with 11 additions and 50 deletions
@@ -24,13 +24,15 @@ $filterWidgetArray = array(
layout: "fitDataFill",
persistentLayout:true,
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
headerFilterPlaceholder: " ",
index: "anrechnungszeitraum_id", // assign specific column as unique id (important for row indexing)
selectable: false, // allow row selection
tableWidgetHeader: true,
tableBuilt: function(){
func_tableBuilt(this);
},
columnDefaults:{
headerFilterPlaceholder:" ",
},
}',
'datasetRepFieldsDefs' => '{
anrechnungszeitraum_id: {visible: false, headerFilter:"input"},
@@ -219,9 +219,7 @@ $filterWidgetArray = array(
selectableCheck: function(row){
return func_selectableCheck(row);
},
rowFormatter:function(row){
func_rowFormatter(row,this);
},
columnDefaults:{
//columnDefaults tooltip did not work
@@ -166,9 +166,6 @@ $filterWidgetArray = array(
selectableCheck: function(row){
return func_selectableCheck(row);
},
rowFormatter:function(row){
func_rowFormatter(row);
},
columnDefaults:{
//columnDefaults tooltip did not work
@@ -294,7 +294,6 @@ ORDER BY "akzeptiert" NULLS FIRST, "erteilt" NULLS LAST, "bestellt"
$filterWidgetArray = array(
'query' => $query,
'bootstrapVersion'=>5,
'tableUniqueId' => 'acceptLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_akzeptieren',
'datasetRepresentation' => 'tabulator',
@@ -305,7 +305,6 @@ ORDER BY "typ" DESC, "auftrag", "personalnummer" DESC, "lektor", "bestellt", "er
$filterWidgetArray = array(
'query' => $query,
'bootstrapVersion'=>5,
'tableUniqueId' => 'approveLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_erteilen',
'datasetRepresentation' => 'tabulator',
@@ -50,7 +50,6 @@ $query = '
$tableWidgetArray = array(
'query' => $query,
'bootstrapVersion' => 5,
'tableUniqueId' => 'cancelledLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_akzeptieren',
'datasetRepresentation' => 'tabulator',
@@ -334,7 +334,6 @@ ORDER BY "typ" DESC, "auftrag", "personalnummer" DESC, "lektor", "bestellt"
';
$filterWidgetArray = array(
'query' => $query,
'bootstrapVersion'=>5,
'tableUniqueId' => 'orderLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_bestellen',
'datasetRepresentation' => 'tabulator',
+6
View File
@@ -39,6 +39,12 @@
z-index: 999999;
}
/* classes for rows that are not selectable in the tabulator */
.tabulator-row.tabulator-unselectable{
color:var(--bs-gray-500);
}
/* using bootstrap background classes to style the background color of tabulator rows */
/* bg-warning */
/* odd-rows */
+1
View File
@@ -1,3 +1,4 @@
.btn-w200
{
width: 200px;
@@ -184,28 +184,7 @@ var format_ectsSumBisherUndNeu = function (cell, formatterParams, onRendered) {
);
};
// Formats the rows
function func_rowFormatter(row) {
let status_kurzbz = row.getData().status_kurzbz;
// If status is anything else then 'Bearbeitet von STGL-Leitung'
if (status_kurzbz != ANRECHNUNGSTATUS_PROGRESSED_BY_STGL) {
// Disable new selection of updated rows
row.getElement().style["pointerEvents"] = "none";
// ...but leave url links selectable
row.getCell("dokument_bezeichnung").getElement().firstChild.style[
"pointerEvents"
] = "auto";
if (row.getCell("details")) {
row.getCell("details").getElement().firstChild.style["pointerEvents"] =
"auto";
}
// Color background grey
row.getElement().style["background-color"] = COLOR_LIGHTGREY; // default
}
}
// Formats row selectable/unselectable
function func_selectableCheck(row) {
@@ -88,20 +88,7 @@ function func_tableBuilt(table) {
table.tabulator("redraw", true);
}
// Formats the rows
function func_rowFormatter(row) {
let status_kurzbz = row.getData().status_kurzbz;
let empfehlungsberechtigt = row.getData().empfehlungsberechtigt;
row.getCells().forEach(function (cell) {
if (
status_kurzbz != ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR ||
empfehlungsberechtigt == "false"
) {
row.getElement().style["background-color"] = COLOR_LIGHTGREY; // default
}
});
}
// Formats row selectable/unselectable
function func_selectableCheck(row) {
@@ -149,8 +149,6 @@ function func_rowFormatter(row) {
return; // bestellte + erteilte
} else if (bestellt != null && erteilt != null && akzeptiert != null) {
cell.getElement().classList.add("bg-success"); // akzeptierte
} else {
row.getElement().style["background-color"] = COLOR_LIGHTGREY; // default
}
});
}
@@ -207,9 +207,6 @@ function func_rowFormatter(row) {
} else if (bestellt != null && erteilt != null && akzeptiert != null) {
cell.getElement().classList.add("bg-success"); // akzeptiert
}
// default color is already set in the Tabulator5.css file that gets loaded the Header flag tabulator5
// row.getElement().style["background-color"] = COLOR_LIGHTGREY; // default
});
}