How do you create the row actions to be like this (screen shot from documentation)
To see just 3 dots and click on them and then show the buttons?
This is the laravel package I'm talking about: https://github.com/z-song/laravel-admin
So the answer to this question would be to simply use the
$grid->setActionClass(Grid\Displayers\DropdownActions::class);
which is enabled by default for laravel-admin in config config/admin.php
/*
|------------------------------------------------------------------------ --
| The global Grid action display class.
|--------------------------------------------------------------------------
*/
'grid_action_class' => \Encore\Admin\Grid\Displayers\DropdownActions::class,
But it was commented out in our project meaning it was disabled.
There is a catch also. If you have custom made RowAction you should use it like this:
$grid->actions(function ($actions) {
$actions->add(new CustomRowAction());
}
namespace App\Admin\Actions\Document;
use Encore\Admin\Actions\RowAction;
class CustomRowAction extends RowAction
{
public $name = 'Button name';
public function handle()
{
// do something here
}
public function dialog()
{
$this->confirm('Are you sure?');
}
}