Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Styling Column In Cgridview

$
0
0
Hi Community,

I'm trying to add a css style to a column in a CGridView, but it doesn't work, here is part of the code:

In admin.php (view folder):
.....
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'juridicas-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array( 'name' =>'id_juridica', 'value' => '$data->id_juridica', 'header' => 'No Empresa', 'htmlOptions' => array('class'=>'red')),
...others columns
array( 'class'=>'CButtonColumn', 'template' => '{view}'),
),
)); ?>

Only I want to display the column 'id_juridica' in red color, so I'd created a class red in my main.css file, here is the code:

main.css
.red
{
color:red;
}

and I'm using 'htmlOptions' => array('class'=>'red') to apply the class in the colummn.

What I'm doing wrong ?, any help will be apreciated, thanks in advance.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>