DGColumn.addWidth

Syntax

addWidth(width: Number, addWidthOnlyForThisColumn: Boolean);

Parameters

width. Added length.

addWidthOnlyForThisColumn. Indicates whether length is added only for this column. If the parameter is set to True, length is added only for this column.

Description

The addWidth method adds length for all columns or for this one only.

Example

To execute the example, the HTML page must contain the DataGrid component named grid (see Example of Creating the DataGrid Component). Enable to change second column width and disable to change percent value of this column width. Increase column of all column by 10:

// Set whether second column width can be changed
var measure = grid.getMeasures();
measure.getColumns()[1].setEnableColumnResize(True);
// Set whether percent width of the first column can be changed
measure.getColumns()[1].setEnableResizePercent(False);
// Increase width of all column by 10
measure.getColumns()[1].addWidth(10);
// Refresh table
grid.refresh();

As a result, width of all columns is increased by 10:

See also:

DGColumn