From 2262169699a8283e417a53da7f73d75524b0c780 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 7 Jul 2025 15:47:34 +0200 Subject: [PATCH] filter component set default height only if no height attribute is set in tabulatoroptions. remove reactivedata default setting and old todo comments --- public/js/components/filter/Filter.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index cf02dccf5..37bea4c84 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -75,7 +75,7 @@ export const CoreFilterCmpt = { newBtnDisabled: Boolean, newBtnLabel: String, uniqueId: String, - // TODO soll im master kommen? + idField: String, parentIdField: String, countOnly: Boolean @@ -216,17 +216,22 @@ export const CoreFilterCmpt = { } // Define a default tabulator options in case it was not provided let tabulatorOptions = {...{ - height: 500, layout: "fitDataStretchFrozen", movableColumns: true, columnDefaults:{ tooltip: true }, placeholder, - reactiveData: true, persistence: this.persistence, }, ...(this.tabulatorOptions || {})}; + // set default height if no height property is set + if (tabulatorOptions.height === undefined && + tabulatorOptions.minHeight === undefined && + tabulatorOptions.maxHeight === undefined) { + tabulatorOptions.height = 500; + } + if (!this.tableOnly) { tabulatorOptions.data = this.filteredData; tabulatorOptions.columns = this.filteredColumns; @@ -234,7 +239,7 @@ export const CoreFilterCmpt = { if (tabulatorOptions.selectable || (tabulatorOptions.columns && tabulatorOptions.columns.filter(el => el.formatter == 'rowSelection').length)) this.tabulatorHasSelector = true; - // TODO check ob im core bleiben soll + if (this.idField) { // enable nested tabulator if parent Id given if (this.parentIdField) tabulatorOptions.dataTree = true; @@ -258,7 +263,7 @@ export const CoreFilterCmpt = { this.tabulator.on("rowSelectionChanged", data => { this.selectedData = data; }); - // TODO check ob im core so bleiben soll + // if nested tabulator, restructure data if (this.parentIdField && this.idField) { this.tabulator.on("dataLoading", data => { @@ -575,7 +580,7 @@ export const CoreFilterCmpt = { this.getFilter ); }, - // TODO check ob im core so bleiben soll + // append child to it's parent appendChild(data, child) { // get parent id