CGriedView & delete button


I’am using the CGriedView widget to display a user list.

In this user list I use the common ‘delete’, ‘view’ and ‘update’ buttons. (CButtonColumn).

Now, I want the ‘delete’ button to be displayed for all users except the current one. Which means to exclude an item to be deleted from the CGriedView widget by removing his ‘delete’ button.

How can I do that ?



see the doc CButtonColumn

there is a visible option

'buttonID' => array(

    'label'=>'...',     // text label of the button

    'url'=>'...',       // a PHP expression for generating the URL of the button

    'imageUrl'=>'...',  // image URL of the button. If not set or false, a text link is used

    'options'=>array(...), // HTML options for the button tag

    'click'=>'...',     // a JS function to be invoked when the button is clicked

    'visible'=>'...',   // a PHP expression for determining whether the button is visible


you may use it like this:

'visible ’ => '$data->id != $currentUserId ’

better to refer this a useful comment and this one just you want

Thank you !

It works :)