I don’t want the delete and update buttons to be shown in the cgridview.
How can I achieve that?
I don’t want the delete and update buttons to be shown in the cgridview.
How can I achieve that?
use template in buttons column and have it as
‘template’=>’{view}’
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'some-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'name',
'etc',
array(
'class'=>'CButtonColumn',
'template' => '{view}',
),
)); ?>
Thanks that solved it
how about removing ‘delete’ and ‘edit’ buttons on certain rows only?
You can use the visible property :
'columns'=>array(
...
array(
'class'=>'CButtonColumn',
'template'=>'{delete}',
'buttons' => array(
'delete' => array(
'visible' => 'strlen($data->trackingnumber)>0',
),
),
),)