Change the EditAction on a RelationManager

I currently have a relationmanager which uses the static table function from it's resource like this:
public function table(Table $table): Table
{
return VacancyResource::table($table);
}
public function table(Table $table): Table
{
return VacancyResource::table($table);
}
Is it possible to change the EditAction so that when I click on Edit it will navigate to the Edit Page instead of opening a modal window?
5 Replies
toeknee
toeknee16mo ago
You should be able to use the getRecordAction and the action returns a url() with openinnewtab ?
Daniel Plomp
Daniel PlompOP16mo ago
I can get the EditAction indeed, but not sure how to change the URL of that action to navigate to the actual Edit Page, instead of opening a modal:
$editAction = VacancyResource::table($table)->getAction('edit');
$editAction->url('https://www.google.com');

// How to replace the edit action?
return VacancyResource::table($table);
$editAction = VacancyResource::table($table)->getAction('edit');
$editAction->url('https://www.google.com');

// How to replace the edit action?
return VacancyResource::table($table);
Daniel Plomp
Daniel PlompOP16mo ago
But recordAction is about the whole row being clickable? I just want to navigate to the Edit page when clicking the edit button. Right now, it seems to 'save' the record when I click the row. So that might be something else that is not working. However, it should be possible to overwrite the EditAction right? On the normal VacancyResource the actions work as expected, but when I load this resource in my RelationManager it doesn't work anymore. Maybe a bug? Not sure.
toeknee
toeknee16mo ago
So remove the edit button completely and add a row action with ->url()
Want results from more Discord servers?
Add your server