PDA

View Full Version : GridViewConfig getRowStyle() help



willbrady
20 Jul 2009, 8:03 AM
I'm trying to use the GridViewConfig's getRowStyle() to modify the style of my rows in a grid. I can successfully change the style of a row, but when I mouse-over or select a row the style does not stick and changes to the default GXT style again. How can I use the getRowStyle() or any other methods to modify those style cases as well? I also have a RowEditor on my grid and want to be able to modify the style of that as well.

I am able to locate within the css page where all of these style ids are defined (.x-grid3-row-over, .x-grid3-row-selected, .x-row-editor) and I can hard code them to change to the colors I want, but I want to be able to use something like the getRowStyle() function to modify all of these situations.

I basically want to say change this row to blue, and then whenever I select, hover, or use the RowEditor on it, have everything still be blue. Then when I change to red, all of those settings change to red. I am doing my change colors through a context menu on the grid which works well for changing the color of the basic row style.

Any help at all on this would be great!

sunshinerain
17 Oct 2009, 5:30 AM
I haven't been able to get this to work either. I tried creating .row-style and .row-style-selected, but
.row-style-selected is not applied, only .x-grid3-row-selected. I've also tried using opacity and other
options in .x-grid3-row-selected, but it does not appear that this style is stacked on top of my style.
Instead, it seems to replace my style.

sunshinerain
19 Oct 2009, 6:25 AM
I was wrong, my provided row-style does remain in place, with .x-grid3-row-selected added on top of
it, but I'm still unable to get it to work. I'd like to be able to provide a different style for the selected
row, depending on what my row style was. For instance, if my row is red, I might want the selected
row to have red text.

I tried the adding ".my-style .x-grid3-row-selected" and ".x-grid3-row-selected .my-style" but those
did not work. I can modify .x-grid3-row-selected but it's a global setting.