PDA

View Full Version : Changing Grid Backgroud Color



akihirokun
23 Jun 2010, 3:43 AM
Hi all,

Need your help for this one. I've been searching how to change the background color of my grid. I need to change the color of all rows, but specially only for a grid, not all of grids that i have.
I found in ext-all.css that the background color can be modified in this part:

.x-grid3-row td, .x-grid3-summary-row td {
line-height:13px;
vertical-align: top;
padding-left:1px;
padding-right:1px;
-moz-user-select: none;
-khtml-user-select:none;
-webkit-user-select:ignore;
background-color: ..... /* this will change the background color */
}

but it effected all of my grids.

Many thanks for your help

-Ridho-

Condor
23 Jun 2010, 3:52 AM
Give your grid a cls (e.g. cls:'my-grid') and use:

.my-grid .x-grid3-row td, .my-grid .x-grid3-summary-row td {
background-color: green;
}

akihirokun
23 Jun 2010, 3:58 AM
Works like charm.. Thx a lot Condor :)
Btw, does this mean that the original css is overridden (only have "background-color") or the original css become having an additional "background-color" ?

Thx again.

Condor
23 Jun 2010, 4:54 AM
Every style property can only have one value, so the best matching css rule will override any specified style properties of css rules with lower rank.