Please check the attachment. Can I place add icon with link on this grid action below?
Thx for looking at this.
Please check the attachment. Can I place add icon with link on this grid action below?
Thx for looking at this.
If you’re using CGridView you can try using the template parameter like:
$this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'table-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'col1',
'col2',
'col3',
array(
'class'=>'CButtonColumn',
'template'=>'{create}{update}{delete}',
),
),
That should add the create (’+’) button to the grid.
If you want to use your own custom icons you can create your own class to extend CButtonColumn and use your own images. Then just override the initDefaultButtons() function and add your own buttons. I did this in my app to add a summary button to the template options.
Check this Link
$this->widget('zii.widgets.grid.CGridView', array(
'id' =>'table-grid',
'dataProvider' => $model->search(),
'filter' => $model,
'columns' => array(
'col1',
'col2',
'col3',
array(
'class' =>'CButtonColumn',
'template' =>'{create}{update}{delete}',
'buttons' => array(
// create
'create' =>
array(
'url' => '$this->grid->controller->createUrl("/controller/action", array("id"=>$data->primaryKey))',
'label' => '<i class="fa fa-eye"></i>',
),
)
),
Thanks, Let me check it.