How to Reload Dashboard Widget from Other Widget after Modal Action?
I have 2 admin widget: borrowed list widget and returned lists widget.
on borrowed lists widget i have a modal action that mark as return and it will move the record to returned widget. from this widget, how can I reload the returned widget to instantly reflect the changes?
6 Replies
Fire event on one widget ant listen in other. Then refresh
I just added this to ReturnedItems Widget
protected $listeners = ['updateLatestReturnedItems' => '$refresh'];
and fire emit from BorrowedItems Widget inside modal action
$this->emit('updateLatestReturnedItems');
Found the solution here: https://filamentphp.com/community/how-to-refresh-widgets-when-table-actions-are-fired
Filament
How to Refresh Widgets When Table Actions Are Fired by Leandro Ferr...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Same thing as written there
yes this is another way. thanks for sharing this. It is a big help to understand the flow.
filter