:: Documentation >>

column width

Sets or retrieves the width of the grid column.

Syntax

var value = obj.getColumnWidth(); 
obj.setColumnWidth(value);        

obj.onColumnWidthChanging = function(value){...}; 
obj.onColumnWidthChanged = function(value){...}; 
obj.onColumnWidthError = function(value){...}; 

Defined in

column model

Examples

obj.setColumnWidth(200, 0); // set column-0 width to 200px

Remarks

setColumnWidth() does not work if given an array of widths, i.e. setColumnWidth([40, 100, 30]) won't work in 2.0.0, you should set values one by one.

It is also possible using CSS rules to specify the width and other visual parameters of the grid columns.

<style>
    #myGrid .aw-column-0 {width:  80px;} 
    #myGrid .aw-column-1 {width: 200px;}
    #myGrid .aw-column-2 {text-align: right;}
    #myGrid .aw-column-3 {text-align: right;}
    #myGrid .aw-column-4 {text-align: right;}
</style>

Comments

resizing the column in grid guest (6)
get Cell position Jingtao (2)
How to get all columns widths ? Shan (1)
Which column's width has changed ? Shan (1)
px versus em Philippe Marzin (4)
How to set a column minium width Mike B (3)
setColumnWidth issues Jim Hunter (www.FriendsOfAW.com) (5)
Cannot get Column Width flashsnake (0)
column width percent Nihal (1)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5