reload \ refresh relation manager table on page action

Is there not an easy way to refresh the a table displayed by a relation manager, when an action on the resource view page completes ?
4 Replies
LeandroFerreira
LeandroFerreira2mo ago
Register an event in the relation manager class https://livewire.laravel.com/docs/events#listening-for-events Dispatch it from your action
Laravel
Events | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Matthew
MatthewOP2mo ago
@Leandro Ferreira, thanks for this help. I've managed to make it jump to a function using $this->dispatch('refreshInvoiceLinesTable'); Then within the relationManager, something like:
#[On('refreshInvoiceLinesTable')]
public function refreshTable()
{
$this->refresh();
}
#[On('refreshInvoiceLinesTable')]
public function refreshTable()
{
$this->refresh();
}
However, I don't what the code needs to be to actually force the refresh of that table. I've had a look through various documentations, but my livewire knowledge is very basic. Appreciate any pointing or specific guidance on this. bump
Solution
dissto
dissto2mo ago
Matthew
MatthewOP2mo ago
Yes, this works, Thanks. Also this works:
#[On('refreshInvoiceLinesTable')]
public function table(Table $table) : Table
{...
#[On('refreshInvoiceLinesTable')]
public function table(Table $table) : Table
{...
Want results from more Discord servers?
Add your server