Mount Existing Table Action From View Record Modal

What I am trying to do: Mount a table action from the record view modal (record clicked and opened from said table), using a hintAction which sits above the form fields. The table action is named 'mark-ledgered'. This action works correctly when clicking the action from the table row itself. What I did: The below code worked in v3. I have attempted to replace the replaceMountedTableAction with replaceMountedAction and mountAction to no avail (changing the params as required). I have tried using a prime component (text) with a htmlString button/JS to mountAction via wire:click but this does not work either. My issue/the error: The modal is not launched/replaced like in v3. Nothing happens. Code:
->hintActions([
Action::make('open-ledgered')
->label(fn(Order $record):string => (($record->items->whereNotNull('ledgered_at')->count() == $record->items->count()) ? 'View Ledgered Items' : 'Mark Items Ledgered'))
->icon('tabler-currency-pound')
->action(function ($livewire, Order $record) {
$livewire->replaceMountedTableAction('mark-ledgered', $record->id) ;
})
])
->hintActions([
Action::make('open-ledgered')
->label(fn(Order $record):string => (($record->items->whereNotNull('ledgered_at')->count() == $record->items->count()) ? 'View Ledgered Items' : 'Mark Items Ledgered'))
->icon('tabler-currency-pound')
->action(function ($livewire, Order $record) {
$livewire->replaceMountedTableAction('mark-ledgered', $record->id) ;
})
])
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?