Dispatch Table Record Action

Hi all

I wondered if its possible to dispatch a table record action from another location.

I know we can do this via URL
?tableAction=view_prices&tableActionRecord=84

but that requires a refresh so I'd like to do this without if possible.

I'd like to go something like $this->dispatch('xxx');

thanks everyone.
Solution
Add to your ListPage
use Livewire\Attributes\On;

#[On('openTableRow')]
public function openTableRow(string $id): void
{
    $this->mountAction('view_prices', [], [
        'table' => true,
        'recordKey' => $id
    ]);
}


You can dispatch it using
Action::make('open')
    ->dispatch('openTableRow', ['id' => '84'])
Was this page helpful?