Dears,
I have a zii.widgets.grid.CGridView bind to a model at form that generates from GII,
All I need to do that how can I give colors to the grid row according to a model filed, it’s like color coding for the grid rows.
Here you are my code
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'events-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'EVENT_ID',
'EVENT_DESC',
'EVENT_MANAGER_ID',
'EVENTTYPE_ID',
'EXPECTEDNO',
'FROMDATE',
'STATUS_ID',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
According the value of ‘STATUS_ID’ I need to set a color, How?
please help 
rookie84
(Lifeline Is)
2
Is this what you want ?
<style>
.red {background: red}
.green {background: green}
</style>
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'page-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'rowCssClassExpression' => '$data->status==="3"?"red":"green"',
...
...
?>
It’s working…
many thanks for you Rookie.
but if there is more than one value, how can I code that expression (status values 1,2,3,…)
these values comes from the database, and the colors as well.
do we have a solution for it
again, many thanks for your help
rookie84
(Lifeline Is)
4
Yes there’s a solution: use some common sense, research a little, its pretty easy… or you want me to have this assignment done for you? 
sure nvm, I’ll do it my self
rookie84
(Lifeline Is)
6
Good, thats how you learn…
why you use $data not $model