Grid Actions
model-grid By default, there are two actions edit and delete, which can be turned off in the following way:
$grid->actions(function ($actions) {
$actions->disableDelete();
$actions->disableEdit();
$actions->disableView();
});You can get the data for the current row by $actions parameter passed in:
$grid->actions(function ($actions) {
// the array of data for the current row
$actions->row;
// gets the current row primary key value
$actions->getKey();
});If you have a custom action button, you can add the following:
$grid->actions(function ($actions) {
// append an action.
$actions->append('<a href=""><i class="fa fa-eye"></i></a>');
// prepend an action.
$actions->prepend('<a href=""><i class="fa fa-paper-plane"></i></a>');
});Custom actions
Starting with v1.7.3, the following documents are deprecated, . please use Custom actions instead.
If you have more complex actions, you can refer to the following ways:
First define the action class:
Then add the action:
Last updated