How to call a method in a button from an screen in another layout or screen? #1939
Unanswered
AkmalArzhang
asked this question in
Q&A
Replies: 2 comments
-
As far as I can understand it's not possible out of the box. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I do not know if I could understand what you want @AkmalArzhang, but to call a button on the form or the listing you can do so. For the form, you can do this: class UserListScreen extends Screen
{
public function commandBar(): array
{
return [
Link::make('Novo')
->icon('pencil')
->route('platform.user.edit')
];
}
} For the DataGrid you can do this: class UserListLayout extends Table
{
protected function columns(): array
{
return [TD::make(__(''))
->align(TD::ALIGN_CENTER)
->width('100px')
->render(function (User $user) {
// dd($user->id);
return
Link::make(__('Editar'))
->route('platform.user.edit', $user->id)
->icon('pencil');
}),
];
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to call a method/function in an screen in another screen on button method. For instance, in EditScreen I have a remove function, while in ListScreen I have a delete button that should call the remove function from EditScreen. How do I do that?
Beta Was this translation helpful? Give feedback.
All reactions