I have a grid in which I need to provide different background colors to various columns.
These column colors should also not be overwritten by the mouse-over
color.
I have tried using cls
and tdCls
but no luck.
Could anyone guide at how this could be achieved?
Thanks in advance.
You do not need a renderer for this. What's happening is that ExtJS's zebra striping style (
x-grid-row-alt
) and mouse over style take precedence over the style you defined intdCls
. Add!important
to the background color and it'll work. For example:NetEmp is right here, you want a renderer and you want to use the direct 'style' method or I did it below using the following:
Note here I check the value on the row in a particular field and then apply the colour to the foreground text and html encode the output, you can obviously just switch things to your specific requirements.
add this to whatever column you want to change color