View Full Version : Apply style from CSS file to ColumnConfig

14 Dec 2011, 3:47 AM

I am trying to set a CSS Style from an external CSS file to the Grid's ColumnConfig.
I have managed to apply style to column using:
priceCC.setStyle("text-align: right; width:8em;");

This works since setStyle expects a string or css style.

But I don't want to have the style explicitly defined in code. I want to have if defined in CSS file and reference it to the ColumnConfig.

How can this be done?


Sefi Ninio
14 Dec 2011, 11:49 PM
Anyone tried this?
I am surprised no one has run into this...

19 Dec 2011, 1:19 AM
every grid's column has built-in style with column id in the end.
you can add style for grid for exact one grid to match.

ColumnConfig column = new ColumnConfig();
Grid grid = new Grid();

column will have style "x-grid3-col-my_id"

You can use style name ".my-grid .x-grid3-col-my_id {color: red;}"
use firebug, it is very helpful.