F
Filament3mo ago
ruddy

Dispatch Modal doesn't work

Hello everyone, Before I ask my question, I took some time to review previous discussions related to dispatching modals in FilamentPHP. I have a modal in my view that looks like this:
<x-filament::modal id="edit-user">
hello
</x-filament::modal>
<x-filament::modal id="edit-user">
hello
</x-filament::modal>
This code is saved in //filament/page/test.blade.php. My table action is set up like this:
Tables\Actions\Action::make('test-modal')
->action(fn ($livewire) => $livewire->dispatch('open-modal', id: 'edit-user')),
Tables\Actions\Action::make('test-modal')
->action(fn ($livewire) => $livewire->dispatch('open-modal', id: 'edit-user')),
However, when I click the button, nothing happens. Did I miss something? Any help would be greatly appreciated! Thank you!
4 Replies
Lara Zeus
Lara Zeus3mo ago
do you have: <x-filament-actions::modals /> in your blade?
ruddy
ruddyOP3mo ago
No , I don't have one, where I have to put it?
Lara Zeus
Lara Zeus3mo ago
like this:
<div>
{{ $this->deleteAction }}

<x-filament-actions::modals />
</div>
<div>
{{ $this->deleteAction }}

<x-filament-actions::modals />
</div>
for ref: https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component#adding-the-action
ruddy
ruddyOP3mo ago
Okay , let me have a look, thanks
Want results from more Discord servers?
Add your server