Skip to main content

adjust

Optional. Defines whether the width of a column is automatically adjusted to its content

Usage

adjust?: "data" | "header" | "footer" | boolean; 

Default value: false

info

You can't enable autoHeight and adjust properties at the same time, as they are mutually exclusive.

Example

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

Take into account the information below:

  • the adjust property has a priority over the autoWidth property if it is specified either for the grid or for the column, and over the width property of the column
  • the width the columns will be adjusted to also depends on the values of the minWidth/maxWidth properties if they are set for a column
note

Note that if you change the font type, size, or offsets, the correct calculation of the adjust property of a cell may not be guaranteed.

Related article: Autosize for columns