在yii2 grid actionColumn中添加更多操作

在yii2 grid actionColumn中添加更多操作,yii2,Yii2,我用的是awesome制作的yii2网格 我的问题是,在“kartik]grid\actionColumn”中有默认操作,即: 查看、更新和删除。 我需要添加另一个操作,如“打印”、“电子邮件”等。 我怎样才能做到这一点 [ 'class' => 'kartik\grid\ActionColumn', 'width' => '100px', 'dropdown' => false, 'vAlign' => 'top', 'hidde

我用的是awesome制作的yii2网格

我的问题是,在“kartik]grid\actionColumn”中有默认操作,即: 查看、更新和删除。 我需要添加另一个操作,如“打印”、“电子邮件”等。 我怎样才能做到这一点

[
    'class' => 'kartik\grid\ActionColumn',
    'width' => '100px',
    'dropdown' => false,
    'vAlign' => 'top',
    'hiddenFromExport' => true,
    'urlCreator' => function ($action, $model, $key, $index) {
        return Url::to([$action, 'id' => $key]);
    },
    'viewOptions' => ['role' => 'modal-remote', 'class' => 'btn btn-xs ', 'title' => 'View', 'data-toggle' => 'tooltip'],
    'updateOptions' => ['role' => 'modal-remote', 'class' => 'btn btn-xs btn-primary', 'title' => 'Update', 'data-toggle' => 'tooltip'],
    'deleteOptions' => ['role' => 'modal-remote', 'class' => 'btn btn-xs btn-danger', 'title' => 'Delete',
                    'data-confirm' => false, 'data-method' => false, // for overide yii data api
                    'data-request-method' => 'post','data-toggle' => 'tooltip','data-confirm-title' => 'Are you sure?','data-confirm-message' => 'Are you sure want to delete this item'],
],

请告知。

您应该使用
模板
按钮
操作列的选项:

[
    'class' => 'kartik\grid\ActionColumn',
    'template' => '{view} {update} {delete} {myaction}', // <-- your custom action's name
    'buttons' => [
      'myaction' => function($url, $model, $key) {
          return Html::a('My action icon', [''my action url];
      }
    ]
...
]
[
'class'=>'kartik\grid\ActionColumn',

'template'=>'{view}{update}{delete}{myaction}',//您应该使用
模板
按钮
操作列
的选项:

[
    'class' => 'kartik\grid\ActionColumn',
    'template' => '{view} {update} {delete} {myaction}', // <-- your custom action's name
    'buttons' => [
      'myaction' => function($url, $model, $key) {
          return Html::a('My action icon', [''my action url];
      }
    ]
...
]
[
'class'=>'kartik\grid\ActionColumn',
'模板'=>'{view}{update}{delete}{myaction}'//