3.2.0

How to set a column minium width

I'm trying to set a minium width for columns in code. I've tried the following:

obj.onColumnWidthChanged = function(value, index){
if(value<60){
obj.setColumnWidth(60, index);
}
};

but with no sucess.
Mike B
June 13,
You should use onColumnWidthChanging event which fires before the change and cancel it if the value is too small (returning non-zero error code or message).

var obj = new AW.UI.Grid;
obj.setCellData("cell");
obj.setHeaderText("header");
obj.setColumnCount(10);
obj.setRowCount(10);
document.write(obj);


obj.onColumnWidthChanging = function(width, column){
    if (width < 50) {
        this.setColumnWidth(50, column);
        return "too small!"; // non-zero error code
    }
}
Alex (ActiveWidgets)
June 13,
Hi Alex

How can we set the width of column as maximum length data of all cells in that particular column ?
For exmaple if a grid has 2 columns and columnA has some data that has length say 12 characters.Now we want that this column should be able to show 12 characters without any wrapping.

Thanks
Vikramaditya garg
Fidelity Investments.
Vikramaditya Garg
June 28,
Was there ever an resolution to the last question?
"How can we set the width of column as maximum length data of all cells in that particular column ?"

I could use this.
Colin P.
October 18,

This topic is archived.

See also:


Back to support forum