Close action modal with event
I have a table action which open a livewire component, I that livewire there is one more table action which open a modal(blade file)
I want to close the livewire component when blade modal is open or close both blade modal and livewire component when blade modal is close
I tried giving id to livewire modal and dispatch close-modal event from second table action but it didn't worked
14 Replies
Just to keep it on
..
maybe this can help you
https://discord.com/channels/883083792112300104/1273718758812422215/1274013631813648466
It worked Perfectly
but when event dispatched from second action's form it closes both modals
Is there any way to dispatch the even from 'X' button of modal
You’ll need to inspect the code to understand what the ‘x’ does and then try to trigger the same action
on click it closes the second modal
I didn't get which action should I try
Shouldn't it be x-on:click in the button?
yes, but in blade file there is no button.
How can I use x-on:click?
..
I didn't understand your question..
like in inspect it dispatch from x-on:click
but in my blade file I didn't mentioned any button.
so, How can I use x-on:click? to dispatch the event
when would you like to dispatch the event?
when user click on 'x' button
I don't know.. maybe you can disable the x button in the modal and create a custom button to dispatch it
OK, thanks for helping me out