I want the delete button to be active only in certain condition in CGgridView
CButtonColumn
(or make a custom delete button) e g if user=='admin'
or status=='draft'
. Any ideas? Thanks!
use 'visible' parameter -
'buttons'=>array
(
'delete' => array
(
'label'=>'Delete',
//other params
'visible'=>!Yii::app()->user->checkAccess('admin'),
),
'visible'=>'$data->status=="draft" || Yii::app()->user->checkAccess("admin")'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With