Skip to main content

autoWidth

Optional. Enables/disables the ability of a column to adjust its size to the size of Grid

Usage

autoWidth?: boolean;

Default value: false

Example

const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "country", header: [{ text: "Country" }], autoWidth: false },
// more columns configuration objects
],
autoWidth: true,
// more options
});

Also note:

  • If autoWidth is set for a column, the width of the column is calculated on the base of the sizes of the container of the grid and the values of the minWidth/maxWidth properties if they are set for the column.
  • The property is ignored if the adjust property is used.
  • If the width property is specified in the configuration object of a column, the autoWidth property won't work for this column.

Related article: Autowidth for columns