3.2.0

how to set column,SOS

how to use javascript let column data align center dynamic,not by using the following css:
aw-column-0 {text-align: center};

the grid column has such attribute?

Thks.
Clark.chen
February 2,
grid.setColumnWidth(width, colIndex);

or

grid.setColumnWidth([w1, w2, w3, ...]);


http://www.activewidgets.com/aw.ui.grid/column-width.html
Alex (ActiveWidgets)
February 2,
I use the following code:

var stylesheet = document.styleSheets[document.styleSheets.length-1];
stylesheet.addRule(".aw-column-"+i, "text-align: right");
clark.chen
February 3,
Sorry, I was answering the wrong question here :-(

Yes, your code is correct. You may also add grid id selector if you are using multiple grids -

stylesheet.addRule("#myGrid .aw-column-" + i, "text-align: right");
Alex (ActiveWidgets)
February 3,

This topic is archived.

See also:


Back to support forum