How to set the default action on table row click

Hi all! It seems an obvious one, but I can't seem to figure out how filament determines the default action when a table row is clicked. I have 2 resources, both have View and Edit actions in the $table->actions() array, yet when clicking a row in 1 of the resources, I am taken to the edit page and the other resource goes to the view page? Thanks!
4 Replies
toeknee
toeknee2w ago
If view action exists it uses that, else it uses table. you can use
->recordAction() too on the table to force one.
Grogu
GroguOP2w ago
Thanks @toeknee When I add this, I still get taken to the view page? ->recordAction(EditAction::class)
dissto
dissto2w ago
Probably need to unset the record url
$table
->recordUrl(null)
->recordAction(EditAction::class)
$table
->recordUrl(null)
->recordAction(EditAction::class)
Grogu
GroguOP2w ago
Thank you @dissto @toeknee !

Did you find this page helpful?