PDA

View Full Version : Grid, getRowClass and selection



wuschba
23 Feb 2011, 1:37 AM
Hello!

I have a grid where I'm displaying the background of some rows in green and some rows in red depending on some values of the row. This works fine using GridView::getRowClass.


But when I'm selecting a row, the background of the row gets blue. So the user cannot see anymore which color the row has without deselecting the row.


I found this thread: http://www.sencha.com/forum/archive/index.php/t-48882.html and added to my background style an !important, like:
.backendGridOk {
background-color:#80ff80 !important;
}
This works overriding the blue background. But now the selected row cannot be distinguished from deselected rows.


What I need would be a way to give selected rows ANOTHER green or red in background compared to deselected rows. How can this be done?

Condor
23 Feb 2011, 2:09 AM
Do you need to support IE6/7/8? In that case you're stuck using this solution (http://www.sencha.com/forum/showthread.php?107535-Change-the-selected-row-s-highlight-color-base-on-a-row-s-column-s-value&p=503189&viewfull=1#post503189).

If you don't, then a simple combined class css rule (.x-grid3-row-selected.my-class) will do.

wuschba
23 Feb 2011, 5:25 AM
combined class works fine, thanks a lot!