Yii Framework Forum: How To Put Line Break In Cgridview Columns? - Yii Framework Forum

Jump to content

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

How To Put Line Break In Cgridview Columns? Rate Topic: -----

#1 User is offline   xander 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 10-September 12

Posted 27 January 2013 - 09:02 AM

I am trying to combine few data fields in one single column in cgridview. I manage to combine them but when I try to put <br/> between the data, it didn't show any line break. Please help.


$this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'officer-grid',
	'dataProvider'=>$dataProvider,
	'columns'=>array(
                array (
                    'name'=>'officer_name',
                    'type'=>'text',
                    'value'=>'$data->salutation.\' \'.$data->officer_name.\'<br />\'.$data->position',
                ),


0

#2 User is offline   seenivasan 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 620
  • Joined: 17-June 12
  • Location:Chennai,TamilNadu,India.

Posted 27 January 2013 - 10:02 AM

Dear Friend

Would you please try something as follows.

$this->widget('bootstrap.widgets.TbGridView',array(
        'id'=>'officer-grid',
        'dataProvider'=>$dataProvider,
        'columns'=>array(
                array (
                    'name'=>'officer_name',
                    'type'=>'raw',
                    'value'=>'$data->salutation."</br>".$data->officer_name."</br>".$data->position',
                ),



Regards.
0

#3 User is offline   xander 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 10-September 12

Posted 13 April 2013 - 11:35 AM

View Postseenivasan, on 27 January 2013 - 10:02 AM, said:

Dear Friend

Would you please try something as follows.

$this->widget('bootstrap.widgets.TbGridView',array(
        'id'=>'officer-grid',
        'dataProvider'=>$dataProvider,
        'columns'=>array(
                array (
                    'name'=>'officer_name',
                    'type'=>'raw',
                    'value'=>'$data->salutation."</br>".$data->officer_name."</br>".$data->position',
                ),



Regards.



Thanks, it works.
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