Hi All. I was trying to insert this code inside a button, using the yii-bootstrap widget, but I couldn’t.
<i class="icon-envelope icon-white"></i>
The idea is to create a green button with the mail icon inside.
I’m using the yii-bootstrap widget BootGridView
I found an alternative using jquery to inject html, but I think it’s more cleaner to have the option directly inside the yii button code.
The piece of code that worked is
<?php $this->widget(‘bootstrap.widgets.BootGridView’, array(
'type'=>'striped bordered condensed',
'id'=>'ns-messages-grid',
'dataProvider'=>$model->searchByFilter($filter),
'filter'=>$model,
'columns'=>array(
…
array(
'class'=>'bootstrap.widgets.BootButtonColumn',
'template' => '{answer}',
'buttons'=>array(
'answer' => array(
'label' => ' ' ,
'options' => array('class' => 'btn btn-success papatel-icon-answer','title' => 'Answer') ,
'url'=>'Yii::app()->createUrl("nsMessages/answerMsgAjax", array("id"=>$data->id))',
'click' => 'function(evt){
evt.preventDefault() ;
answerMsg($(this).attr("href"), $(this).parent().parent().children(":nth-child(2)").text());
}' ,
'visible' => '! is_object($data->responsesms)' ,
),
…
…
<script>
$(’.papatel-icon-answer’).html(’<i class=“icon-envelope icon-white”></i>’) ;
</script>
The option to add html code inside cbutton could be available soon?
thanks.