How to hide the delete button on CGridView in Yii


Just a simple thing but hard to find on the Yii documentation.

just add the following code in the delete button definition section in CGridView implementation,

array(
‘class’=>’CButtonColumn’,
‘buttons’=>array(
‘update’ => array
(
‘url’=>’Yii::app()->createUrl(“accusee/update”, array(“id”=>$data->id))’,
),
‘view’ => array
(
‘url’=>’Yii::app()->createUrl(“accusee/view”, array(“id”=>$data->id))’,
),
‘delete’ => array
(
‘url’=>’Yii::app()->createUrl(“accusee/delete”, array(“id”=>$data->id))’,
 ‘visible’=>’false’,
),
),
),

Advertisements

Let me know what you think .. :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s