Dyanmically setting column alignment/width


Just wondering if there was a way of dynamically setting column alignment and width. I've got a grid which through Ajax changes it's columns based on a CSV data source - headings and formats all work ok, but struggling to find a non CSS method for width and alignment.

Any help would be much appreciated.


(using latest version/extended grid)
Charles Dean
October 8,
Use setColumnWidth() method -

obj.setColumnWidth(200, 1); // column-1
obj.setColumnWidth([50, 100, 150, 200]); // all columns (array)

Text alignment could be set applying styles to the cell template -

obj.getCellTemplate(1).setStyle('text-align', 'right'); // column-1
Alex (ActiveWidgets)
October 9,
Thanks Alex - works perfectly.
Charles Dean
October 11,

This topic is archived.

See also:

Back to support forum