I want to hide Yii2 GridView Action Column buttons on the base of model field status. If status is = 1 then hide view button only. How I can?
Code:
Use visibleButtons property from ActionColumn class:
visibleButtons
ActionColumn
[ 'class' => 'yii\grid\ActionColumn', 'visibleButtons' => [ 'view' => function ($model, $key, $index) { return $model->status !== 1; } ] ]
Reference: https://www.yiiframework.com/doc/api/2.0/yii-grid-actioncolumn#$visibleButtons-detail