I’m trying to label my CGridView with both a unique class and the standard odd/even class
These don’t work:
'rowCssClassExpression'=>'"row_id_" . $row . " " . $row%2?"odd":"even"',
'rowCssClassExpression'=>'"row_id_" . $row . " " . array("odd","even")',
Doh; nothing like a new day to see the obvious.
I’m getting execution precedence mixed up.
This works:
'"row_id_" . $row . " " . ($row%2?"even":"odd")'
willowdan
(Willowdan)
3
For the benefit of those who are not yet clear,
'rowCssClassExpression'=>'(isCurrent($data)==1)? rowopen : "row_id_" . $row . " " . ($row%2?"even":"odd")',
I’m thankful I came across this topic and implemented it in my own project, of combining customized CSS class and the odd/even classes.
Cheers!