webfriend13
17 Jun 2012, 9:22 PM
HI All,
I am using following code to loop through the grid. The idea is to set the width of the grid columns.
var columnCount = grid.getView().getHeaderCt().getColumnCount();
var gridColumns = grid.getView().getHeaderCt().getGridColumns();
for (var i = 1; i < columnCount; i++) {
var colWidth = (columnLength[i - 1][i - 1] * 7);
gridColumns[i].setWidth(colWidth);
}
I am using column index to refer to column. I want to refer the column by its name rather than using the index.
gridColumns['firstColumnName'].setWidth(colWidth);
Is it possible?
I am using following code to loop through the grid. The idea is to set the width of the grid columns.
var columnCount = grid.getView().getHeaderCt().getColumnCount();
var gridColumns = grid.getView().getHeaderCt().getGridColumns();
for (var i = 1; i < columnCount; i++) {
var colWidth = (columnLength[i - 1][i - 1] * 7);
gridColumns[i].setWidth(colWidth);
}
I am using column index to refer to column. I want to refer the column by its name rather than using the index.
gridColumns['firstColumnName'].setWidth(colWidth);
Is it possible?