Dynamically Adjusting Grid Column Width


#1

Hi There

Is there an easy way to dynamically control the width of the Columns in the Grid. Either by word wrap or adjusting the coumn width based on the content. (or both)

I know I can adjust these programatically, I just wondered it there was a more elegant solution that didn’t involve user input after the Gantt has loaded.

See screen shot showing how the task names are cut short. We are looking for these to wrap and/or dynamically adjust the task name column width.

Many Thanks!

Chris


#2

Hello,
unfortunately there is nothing built-in for this. We are considering adjusting grid sizing in the upcoming update, but right now there is nothing specific about such use-case.


#3

Hi,
Is there any update on this?


#4

Hi,
still no built-in solution,
however you can check the demo of how the task can be solved using a public api -
docs.dhtmlx.com/gantt/snippet/4043c840 - each time data is rendered or updated the code traverses task tree, estimates the size of the longest description and adjusts sizes of a grid.


#5

Hi,
Is there any update on this?


#6

Hello Prakash,
Unfortunately, it is still not a built-in feature.
We still have that task in the tracker, and someday, the dev team will implement that. I cannot give you an ETA, but I will notify you when it is implemented.
However, there is another implementation of that functionality:
https://docs.dhtmlx.com/gantt/snippet/0c73a23a


#7

Hello everyone,
The dev team added the feature that allows stretching the grid even when it has the scrollbar:
https://docs.dhtmlx.com/gantt/api__gantt_grid_elastic_columns_config.html
You can see how it works in the following sample:
http://snippet.dhtmlx.com/5/5f524d22e