Page 1 of 1

Nested modal inside Dataview

Posted: 14 Nov 2022, 19:29
by stekosto
Hi,

I have used in Dataview template the attribute dataKey="something_unique" and the paginator works fine.
Now I want to use a Dialog on each item the Dataview template but when I click the Dialog button, all modals in the list open.
I know I can change the methods (openModal, closeModal) to use event.target or to change the component source code,
but is there any other way?

Thank you

Re: Nested modal inside Dataview

Posted: 16 Nov 2022, 18:15
by stekosto
Moved modal out of the Dataview (v-for) and leave button in Dataview (in loop).
Button emits an event which trigger the modal to open in parent component along with specific data (conditionaly based e.g. a unique id for a specific item) to populate the modal

Re: Nested modal inside Dataview

Posted: 12 Dec 2022, 00:08
by JD45
Hi,

I'm looking to do exactly the same thing you are.

I have a data table for user notifications, and I'd like the user to open a modal with specific data related to that row item.

How did you pass the data from your table row to your modal?

Thank you!!

-Jason

Re: Nested modal inside Dataview

Posted: 26 Dec 2022, 10:08
by tugce.kucukoglu
You could check delete and edit functionality in the crud example. https://www.primefaces.org/primevue/datatable/crud