Add class with rowCssClassExpression

I need add class to row in cgridview.

I used rowCssClassExpression:


'rowCssClassExpression'=>'"$data->id"'

But I lost calss odd and even.

I want add $data->id to the every row and not lost class odd and even.

You can return odd and even from your code, so:




'rowCssClassExpression' => function($row, $data)

{

     $classValue = ( (($row%2)==0)?'even':'odd' ).' '.$data->id;

     return $classValue;

}