F
Filamentβ€’6mo ago
Rome

Open custom modal action on record click

I need to open a custom modal action on row click. I've tried in recordUrl() and in recordAction() with no luck.
Solution:
if you create a custom action, you should add in the table ```php $table ->recordUrl(null)...
Jump to solution
9 Replies
LeandroFerreira
LeandroFerreiraβ€’6mo ago
Did you add a row action in the table?
Rome
RomeOPβ€’6mo ago
What do you mean with row action? Right now I have an action to open a custom modal, but I need to open it when i click on the row and not on the button.
LeandroFerreira
LeandroFerreiraβ€’6mo ago
Could you share your action?
Rome
RomeOPβ€’6mo ago
Tables\Actions\Action::make('Test') ->modalContent(fn (Model $record): View => view( 'filament.pages.elemento-ventas', ['ventas' => $record->pivot->ventas], )),
Solution
LeandroFerreira
LeandroFerreiraβ€’6mo ago
if you create a custom action, you should add in the table
$table
->recordUrl(null)
->recordAction('yourActionName')
$table
->recordUrl(null)
->recordAction('yourActionName')
LeandroFerreira
LeandroFerreiraβ€’6mo ago
$table
->recordUrl(null)
->recordAction('Test')
$table
->recordUrl(null)
->recordAction('Test')
Rome
RomeOPβ€’6mo ago
Ohh nice!! Its working So to make it work, I need to have the action in the row? I can not hide it?
LeandroFerreira
LeandroFerreiraβ€’6mo ago
yes, this is a row action πŸ˜€
Rome
RomeOPβ€’6mo ago
Well, atleast I can hide it in the action group Thanks a lot Leandro!
Want results from more Discord servers?
Add your server