Hi All,
I would like to change the delete button’s apariance showed in the gridview. I have tried several things but not working…
This is what the button looks like now:
<td href="/yii4/htdocs/index.php/blog/postmedia/ajaxdelete/id/PostMedia">
<a class="btn btn-danger" href="/yii4/htdocs/index.php/blog/postmedia/ajaxdelete/id/112" rel="tooltip" title="Remove">
<i class="icon-trash"></i>
</a>
</td>
and I want to get this:
<td href="/yii4/htdocs/index.php/blog/postmedia/ajaxdelete/id/PostMedia">
<a class="btn btn-danger" href="/yii4/htdocs/index.php/blog/postmedia/ajaxdelete/id/112" rel="tooltip" title="Remove">
<i class="icon-trash icon-white"></i>
Remove
</a>
</td>
If I try to modify the default delete button, I can’t put the lable “Remove” and I can’t change the icon class.
If I try to add a custom button, then… I can’t add a icon class inside <a> tags and also the call action doesn’t work as expected because it’s not a POST request (I don’t know why)
Here is what I have tried:
array('class'=>'bootstrap.widgets.TbButtonColumn',
'template'=>'{delete} {remove}',
'deleteButtonLabel' => 'Remove',
//'cssClassExpression' => 'CHtml::tag("i", array("class" => "icon-trash icon-white"),"")',
'deleteButtonOptions' => array ('class'=>'btn btn-danger',
),
'deleteButtonUrl'=>'Yii::app()->createUrl("/blog/postmedia/ajaxdelete", array("id"=>$data["id"]))',
'htmlOptions'=>array(
'href'=>Yii::app()->createUrl('/blog/postmedia/ajaxdelete', array('id'=>$model->id,)),
),
'buttons' => array(
'remove' => array(
'label'=>'Remove',
'url'=>'Yii::app()->createUrl("/blog/postmedia/ajaxdelete", array("id"=>$data["id"]))',
'options'=>array(
'href'=>Yii::app()->createUrl('/blog/postmedia/ajaxdelete', array('id'=>$model->id,)),
'class'=>'btn btn-danger',
),
),
),
),
I would appreciate some help, thanks a lot!