-
By default, tables use the route of the ViewRecord as the URL in cell anchor links (if one exists). How would one override this, so that when a cell is clicked, the action is the EditRecord's route? i.e Looking to make the edit action 'default', whilst retaining the view action as an option on the right hand side of the table. Tx |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Try this, on the List page class: protected function getTableRecordUrlUsing(): ?Closure
{
return function (Model $record): ?string {
$resource = static::getResource();
if (! $resource::canEdit($record)) {
return null;
}
return $resource::getUrl('edit', ['record' => $record]);
};
} |
Beta Was this translation helpful? Give feedback.
-
@danharrin Works a treat - thanks kindly for the support! |
Beta Was this translation helpful? Give feedback.
-
add it in table after column it is one line solution.
|
Beta Was this translation helpful? Give feedback.
Try this, on the List page class: