:: Forum >>

Dyanmically setting column alignment/width

Alex,

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.

Thanks

Charles.
(using latest version/extended grid)
Charles Dean
Monday, October 8, 2007
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)
Tuesday, October 9, 2007
Thanks Alex - works perfectly.
Charles Dean
Thursday, October 11, 2007

This topic is archived.


Back to support forum

Forum search