adjusts the width of columns inside a scrollable grid
gantt.config.grid_elastic_columns = true;
...
gantt.init("gantt_here");
The property works only when a grid has a horizontal scrollbar.
By default, dhtmlxGantt doesn't adjust the size of columns during resizing of the whole grid.
Therefore, when the width of the grid increases, the width of columns will remain the same. As a result, an empty space will appear on the right side of the grid. In case the width of the grid decreases, the horizontal scroll will be displayed in the grid.
To make columns dependent on the grid size, set grid_elastic_columns to true:
gantt.config.grid_elastic_columns = true;
Related sample: Elastic columns of Grid
Now, if the width of the grid is changed, the width of columns will be also resized, and vice versa:
One more option is to set the value of the property to "min_width":
gantt.config.grid_elastic_columns = "min_width";
In this case:
added in v7.0
Back to top