Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable does not honor initial selection #1111

Closed
harveylee opened this issue Mar 24, 2021 · 1 comment
Closed

DataTable does not honor initial selection #1111

harveylee opened this issue Mar 24, 2021 · 1 comment

Comments

@harveylee
Copy link
Contributor

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 think perhaps something like this should be implemented in the mounted hook of DataTable.vue?

@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working priority - high labels May 10, 2021
@cagataycivici cagataycivici self-assigned this May 11, 2021
@cagataycivici cagataycivici added this to the 3.5.0 milestone May 11, 2021
@cagataycivici cagataycivici removed Type: Bug Issue contains a bug related to a specific component. Something about the component is not working priority - high labels May 14, 2021
@cagataycivici cagataycivici removed their assignment May 14, 2021
@cagataycivici cagataycivici removed this from the 3.5.0 milestone May 14, 2021
@cagataycivici
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants