How do I add a button in the column action, row filter inside the GridView Yii framework 2. I know how to customize or add button in any row and any column, except the cell of the action column and the filter row of GridView.
Asked
Active
Viewed 1,069 times
1 Answers
0
Add custom button in action column.
[
'class' => 'yii\grid\ActionColumn',
'template' => '{my_action}',
'buttons' => [
'my_action' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-check"></span>', $url,
[
'title' => Yii::t('app', 'My Action'),
]);
}
],
'urlCreator' => function ($action, $model, $key, $index) {
if ($action === 'my_action') {
return Url::to(['user/my-action']);
}
}
],

Muhammad Shahzad
- 9,340
- 21
- 86
- 130
-
1not just inside the action column but in the filter row as well. Thank you! – O Connor Jun 22 '16 at 04:44