You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using v-model:selection="selectedItems" to bind a Vue ref to the data table selection, the data table is not created with any selection even if selectedItems is populated.
A workaround I am using is to call updateSelectionKeys when the component is mounted, i.e.:
// Vue 3 script setup syntax const dataTable = ref(null) // points to data-table ref in SFC template onMounted(() => { if (dataTable.value.dataKey) { dataTable.value.updateSelectionKeys(selectedItems.value) } })
I've tried various cases but unable to replicate with the latest PrimeVue 3.4.1. If the issue persists, please try with the latest version available and create a new ticket with our codesandbox template fork so that we can work on it again. Thank you.
When using
v-model:selection="selectedItems"
to bind a Vue ref to the data table selection, the data table is not created with any selection even ifselectedItems
is populated.A workaround I am using is to call
updateSelectionKeys
when the component is mounted, i.e.:// Vue 3 script setup syntax const dataTable = ref(null) // points to data-table ref in SFC template onMounted(() => { if (dataTable.value.dataKey) { dataTable.value.updateSelectionKeys(selectedItems.value) } })
I think perhaps something like this should be implemented in the
mounted
hook of DataTable.vue?The text was updated successfully, but these errors were encountered: