From 69a27531b76123bfc2d4c5fbf8881b260c7c61d0 Mon Sep 17 00:00:00 2001 From: Melissa Autumn Date: Fri, 16 Aug 2024 11:39:39 -0700 Subject: [PATCH] Clear the data table's selected rows on send. --- frontend/src/components/DataTable.vue | 10 +++++++++- frontend/src/views/admin/WaitingListPanelView.vue | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/DataTable.vue b/frontend/src/components/DataTable.vue index fd7cbfcb4..79bcde2c9 100644 --- a/frontend/src/components/DataTable.vue +++ b/frontend/src/components/DataTable.vue @@ -129,7 +129,7 @@ interface Props { const props = defineProps(); const { - dataList, dataKey, columns, dataName, allowMultiSelect, loading, + dataList, dataKey, columns, dataName, allowMultiSelect, loading } = toRefs(props); const { t } = useI18n(); @@ -146,6 +146,14 @@ const columnSpan = computed(() => (columns.value.length + (allowMultiSelect.valu const selectedRows = ref([]); const mutableDataList = ref(null); +const clearSelectedRows = () => { + selectedRows.value = []; +} + +defineExpose({ + clearSelectedRows, +}); + /** * Returns either a filtered data list, or the original all nice and paginated */ diff --git a/frontend/src/views/admin/WaitingListPanelView.vue b/frontend/src/views/admin/WaitingListPanelView.vue index 414ccbe95..b2abee193 100644 --- a/frontend/src/views/admin/WaitingListPanelView.vue +++ b/frontend/src/views/admin/WaitingListPanelView.vue @@ -34,6 +34,7 @@ const loading = ref(true); const pageError = ref(''); const pageNotification = ref(''); const selectedFields = ref([]); +const dataTableRef = ref(null); const filteredUsers = computed(() => waitingListUsers.value.map((user) => ({ id: { @@ -216,6 +217,7 @@ const sendInvites = async () => { // Unselect everything! selectedFields.value = []; + dataTableRef.value.clearSelectedRows(); await refresh(); loading.value = false; @@ -254,6 +256,7 @@ onMounted(async () => {