Issue to set min width

Hi everyone,

I use the parameters :
gantt.config.min_column_width = 10;
gantt.config.min_grid_column_width = 10;

to able auto sizing to set the width at the minimum possible value (my column content is bigger than 10px)
The problem is when I focus on a scale or grid cell, I have this :

Style inline {
width: 75px;
height: 19px;
position: absolute;
left: [Value depending on the focused cell]
}

Moreover, with a configuration like :
gantt.config.min_column_width = 100;
gantt.config.min_grid_column_width = 100;

I have the correct width (100px) set in the previous Style inline.

Did someone could help me to fix this ?

P.S. : I hope my english is clear enough to explain this…

Hello,

Could you please clarify which exactly element has these styles? And when? After the page is loaded?

min_grid_column_width - this config sets the minumum possible width you can set for the grid columns while being resized.
For example,

  • if default width of the column is 70 and min_grid_column_width = 70, you can’t reduce the width;
  • if default width of the column is 70 and min_grid_column_width = 50, you can reduce the width only by 20 px;
  • if default width of the column is 70 and min_grid_column_width = 100, when you start to resize, the width is increased to 100 (seems it’s the second situation you described).

To set default width of a column, use attribute width in the related column’s object:
docs.dhtmlx.com/gantt/desktop__ … sofcolumns

Hello,
I am experimenting the same issue.
Initially, I have: width and min_width like 60
But, after resizing i just persisting width like 110 but… when open again the Gantt the width for specific column is 60, this is taking always the min_width.
Can someone have any ideas in orden to Solve this?

Thanks in advance.

PSD: I am using v. 5.1.2

Hopefully, I found a solution:
I am using two events: onColumnResizeStart, onColumnResizeEnd

Into onColumnResizeStart() I am resetting the min_width and in onColumnResizeEnd() I am applying the logic to save the width. And How I am resetting the min_width?

gantt.config.columns.map(function(column) { column.min_width = min_width_you_want});

Hello Rocio,
The column width depends on several parameters: the width parameter in the column configuration and the gantt.config.grid_width parameter. Also, if the width parameter of any column is not specified or set to *, Gantt will change the width of some columns:
https://docs.dhtmlx.com/gantt/api__gantt_columns_config.html

Also, Gantt doesn’t have a way to store the configuration somewhere on the backend. All configuration is loaded from the gantt.config parameter.
So, you need to manually implement a solution to update the config parameters and save them somewhere.