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.
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.