Row custom action #1642
Answered
by
kubre
Legoraccio
asked this question in
Q&A
Row custom action
#1642
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
kubre
Mar 30, 2021
Replies: 1 comment 1 reply
-
For a single action you can TD::make('actions', 'Actions')
->render(function (Model $m) {
return Link::make('Edit')->icon('pencil')->route('myroute.edit', $m);
}) For multiple actions you can add dropdown (Example from UserListLayout) TD::make(__('Actions'))
->align(TD::ALIGN_CENTER)
->width('100px')
->render(function (User $user) {
return DropDown::make()
->icon('options-vertical')
->list([
Link::make(__('Edit'))
->route('platform.systems.users.edit', $user->id)
->icon('pencil'),
Button::make(__('Delete'))
->icon('trash')
->method('remove') // remove method defined in Screen
->confirm(__('Once the account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.'))
->parameters([
'id' => $user->id,
]),
]);
}),
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Legoraccio
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a single action you can
For multiple actions you can add dropdown (Example from UserListLayout)