mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 14:32:18 +00:00
Optimized performance of all 'Alle auswählen'-buttons defined via tableWidgetHook
...by passing an array of rows to be selected, instead of selecting each row one by one. Further triggered functions, e.g. rowSelectionChanged, are now called once only, not for each row.
This commit is contained in:
@@ -222,11 +222,12 @@ var format_empfehlung_anrechnung = function(cell, formatterParams){
|
||||
* (Ignore rows that are approved, rejected or in request for recommendation)
|
||||
*/
|
||||
function tableWidgetHook_selectAllButton(tableWidgetDiv){
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
var resultRows = tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
.filter(row =>
|
||||
row.getData().status_kurzbz == ANRECHNUNGSTATUS_PROGRESSED_BY_STGL
|
||||
)
|
||||
.forEach((row => row.select()));
|
||||
);
|
||||
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('selectRow', resultRows);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,11 +127,12 @@ var format_empfehlung_anrechnung = function(cell, formatterParams){
|
||||
* (Ignore rows that are approved, rejected or in request for recommendation)
|
||||
*/
|
||||
function tableWidgetHook_selectAllButton(tableWidgetDiv){
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
var resultRows = tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
.filter(row =>
|
||||
row.getData().status_kurzbz == ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR
|
||||
)
|
||||
.forEach((row => row.select()));
|
||||
);
|
||||
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('selectRow', resultRows);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -274,12 +274,13 @@ function func_renderComplete(table){
|
||||
* Select all (filtered) rows and ignore rows that are bestellt and erteilt
|
||||
*/
|
||||
function tableWidgetHook_selectAllButton(tableWidgetDiv){
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
var resultRows = tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
.filter(row => row.getData().bestellt != null && // bestellt
|
||||
row.getData().erteilt != null && // AND erteilt
|
||||
row.getData().akzeptiert == null && // AND NOT akzeptiert
|
||||
row.getData().status != 'Geändert') // AND NOT geändert
|
||||
.forEach((row => row.select()));
|
||||
row.getData().status != 'Geändert'); // AND NOT geändert
|
||||
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('selectRow', resultRows);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -319,12 +319,13 @@ function func_rowUpdated(row){
|
||||
* Select all (filtered) rows that are bestellt
|
||||
*/
|
||||
function tableWidgetHook_selectAllButton(tableWidgetDiv){
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
var resultRows = tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
.filter(row => row.getData().personalnummer >= 0 && // NOT dummies
|
||||
row.getData().bestellt != null && // AND bestellt
|
||||
row.getData().erteilt == null && // AND NOT erteilt
|
||||
row.getData().status != 'Geändert') // AND NOT geaendert
|
||||
.forEach((row => row.select()));
|
||||
row.getData().status != 'Geändert'); // AND NOT geaendert
|
||||
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('selectRow', resultRows);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -343,7 +343,7 @@ function func_rowUpdated(row){
|
||||
* Select all (filtered) rows and ignore rows which have status bestellt
|
||||
*/
|
||||
function tableWidgetHook_selectAllButton(tableWidgetDiv){
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
var resultRows = tableWidgetDiv.find("#tableWidgetTabulator").tabulator('getRows', true)
|
||||
.filter(row => (
|
||||
row.getData().personalnummer > 0 || // not dummies
|
||||
row.getData().personalnummer == null) && // include Projektbetreuer
|
||||
@@ -355,8 +355,9 @@ function tableWidgetHook_selectAllButton(tableWidgetDiv){
|
||||
(row.getData().bestellt != null && // OR (bestellt
|
||||
row.getData().status == 'Geändert') // AND geaendert)
|
||||
)
|
||||
)
|
||||
.forEach((row => row.select()));
|
||||
);
|
||||
|
||||
tableWidgetDiv.find("#tableWidgetTabulator").tabulator('selectRow', resultRows);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user