Filter Cmpt: handle rowselection via setup option

This commit is contained in:
cgfhtw
2023-12-22 11:05:41 +01:00
parent 787d479a33
commit 4503e0db71
+3 -3
View File
@@ -199,7 +199,7 @@ export const CoreFilterCmpt = {
tabulatorOptions.columns = this.filteredColumns;
}
if (tabulatorOptions.columns && tabulatorOptions.columns.filter(el => el.formatter == 'rowSelection').length)
if (tabulatorOptions.selectable || (tabulatorOptions.columns && tabulatorOptions.columns.filter(el => el.formatter == 'rowSelection').length))
this.tabulatorHasSelector = true;
// Start the tabulator with the build options
@@ -235,7 +235,7 @@ export const CoreFilterCmpt = {
}
},
_updateTabulator() {
this.tabulatorHasSelector = this.filteredColumns.filter(el => el.formatter == 'rowSelection').length;
this.tabulatorHasSelector = this.tabulatorOptions.selectable || this.filteredColumns.filter(el => el.formatter == 'rowSelection').length;
this.tabulator.setColumns(this.filteredColumns);
this.tabulator.setData(this.filteredData);
},
@@ -529,7 +529,7 @@ export const CoreFilterCmpt = {
<span class="fa-solid fa-rotate-right" aria-hidden="true"></span>
</button>
<span v-if="$slots.actions && tabulatorHasSelector">Mit {{selectedData.length}} ausgewählten: </span>
<slot name="actions" v-bind="tabulatorHasSelector ? selectedData : []"></slot>
<slot name="actions" v-bind="{selected: tabulatorHasSelector ? selectedData : []}"></slot>
</div>
<div class="d-flex gap-1 align-items-baseline flex-grow-1 justify-content-end">
<span v-if="!tableOnly">[ {{ filterName }} ]</span>