yii - Multiline in CGridView column -


i have been searching through internet answer question haven't found one. problem have column in cgridview contains blob. blob comment written users , can edited. comment can have single sentence or can contain many paragraphs. in case, want sure in cgridview separation between paragraphs visible.

for now, cgridview displaying comment doesn't respect lineskips. how do that?

$this->widget('zii.widgets.grid.cgridview', array( 'id'=>'grid-demande', 'dataprovider'=>$dataproviderdemande, 'emptytext'=>'no data', 'cssfile'=>yii::app()->request->baseurl."/css/my_gridview.css", 'columns'=>array (     array(                     'name'=>'ch_comment',         'type'=>'raw',         'htmloptions'=>array('width'=>'21%'),     ), ); 

try following column definition in gridview:

array(                 'name'=>'ch_comment',     'value'=>'nl2br($data->ch_comment)',     'type'=>'raw',     'htmloptions'=>array('width'=>'21%'), ), 

this convert line breaks <br /> tags, should solve issue.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

Reversible shuffling a int array in java -