Yii Framework Forum: Add Option In Cbutton To Add Html Code Inside - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Add Option In Cbutton To Add Html Code Inside Rate Topic: -----

#1 User is offline   apolinux 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 13-February 12

Posted 18 September 2012 - 10:37 AM

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.
I prefer to teach fishing rather than give some fish
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users