Skip to content

Row custom action #1642

Answered by kubre
Legoraccio asked this question in Q&A
Mar 29, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Legoraccio
Comment options

Answer selected by Legoraccio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants