TbExtendedGridView - row colors

Hi,

I have an application calling the TbExtendedGridView widget.

I added ‘rowCssClassExpression’ => ‘ticketassignments->color($this->ticket_id)’,

Then created

public function color($myid) {

		$color = 'green';  // testing


	return $color;

This is supposed to pass the ‘green’ value to the css script.

The problem I’m having is determining which css file to use.

in the .\public\assets\9e142ad5\gridview\styles.css I’ve added

tr.green

{

background: #CEF6D8;

}

.grid-view table.items tr.green

{

background: #CEF6D8;

}

this has had no affect.

I’ve attempted modifying the override.css, and main.css in the public/css folder as well, to no affect.

I have searched thru my controllers, looking for a statement registering any css files, but have been unable to locate them so far.

Any help would be highly appreciated.

Thanks,

Randy

This may help

http://www.yiiframework.com/doc/api/1.1/CClientScript#registerCss-detail

http://www.yiiframework.com/wiki/800/how-to-register-scripts-and-css/

Wiki article a bit off topic

Better link (to the CSS part)

http://www.yiiframework.com/wiki/800/how-to-register-scripts-and-css/#hh1

Google: site:yiiframework.com 1.1 CClientscript

You will find old threads like this:

http://www.yiiframework.com/forum/index.php/topic/30314-cclientscriptpos-head-and-real-position/

Thanks Tri,

I did a search and found 164 css files.

Randy

Register your own CSS and have it placed after any existent CSS it should extend/override.

By mistake I added my reply at the end of your post. Sorry for that.

I added links to examples how to register CSS.

Looking at your code, I recommend you first try with a unused class name (not "green"), and enter it directly as "rowCssClassExpression" until you have sorted things out (e.g which element should have CSS added).

(Last time, 5 years ago, I used Firebug to examine elements and their chain of CSS in effect, including file names.)

Thank you Tri, I’ll give it a try.

I do appreciate your help, as I’m not finding documentation on this feature I’m trying to implement.