From ae09e24acc67e9795fe1ee542485539917400748 Mon Sep 17 00:00:00 2001 From: Ben Charmes <107116804+BenjaminCharmes@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:14:17 +0000 Subject: [PATCH] Allow both search and filter to be specified simultaneously in entry table (#1010) --- webapp/src/components/DynamicDataTable.vue | 4 ++++ webapp/src/components/DynamicDataTableButtons.vue | 3 +++ 2 files changed, 7 insertions(+) diff --git a/webapp/src/components/DynamicDataTable.vue b/webapp/src/components/DynamicDataTable.vue index 76df1c10f..ec1759ace 100644 --- a/webapp/src/components/DynamicDataTable.vue +++ b/webapp/src/components/DynamicDataTable.vue @@ -32,6 +32,7 @@ :filters="filters" :editable-inventory="editable_inventory" :show-buttons="showButtons" + @update:filters="updateFilters" @open-create-item-modal="createItemModalIsOpen = true" @open-batch-create-item-modal="batchCreateItemModalIsOpen = true" @open-qr-scanner-modal="qrScannerModalIsOpen = true" @@ -362,6 +363,9 @@ export default { }); }, methods: { + updateFilters(newFilters) { + this.filters = newFilters; + }, goToEditPage(event) { const row = event.data; let row_id = null; diff --git a/webapp/src/components/DynamicDataTableButtons.vue b/webapp/src/components/DynamicDataTableButtons.vue index b32e9bbb4..35cff1ae4 100644 --- a/webapp/src/components/DynamicDataTableButtons.vue +++ b/webapp/src/components/DynamicDataTableButtons.vue @@ -164,6 +164,9 @@ export default { this.isSelectedDropdownVisible = false; } }, + "localFilters.global.value"(newValue) { + this.$emit("update:filters", { ...this.filters, global: { value: newValue } }); + }, }, methods: { confirmDeletion() {