:: Home >>

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

9 Apr 10
resizing the column in grid guest (6)
11 Mar 10
get Cell position Jingtao (2)
15 Mar 08
How to get all columns widths ? Shan (1)
Which column's width has changed ? Shan (1)
17 Dec 07
px versus em Philippe Marzin (4)
18 Oct 06
How to set a column minium width Mike B (3)
23 Aug 06
setColumnWidth issues Jim Hunter (www.FriendsOfAW.com) (5)
17 Jul 06
Cannot get Column Width flashsnake (0)
8 Mar 06
column width percent Nihal (1)

Comments will appear on this page and in the main forum.

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