How do I freeze a column

I want to freeze a column. Fixed columns do not scroll when the scroll bar scrolls horizontally

Hello,
You can do that by adding several grids in the layout configuration:
https://docs.dhtmlx.com/gantt/desktop__layout_config.html#configsandtemplatesofviews
Here are examples of how it can be implemented:
http://snippet.dhtmlx.com/d6be1467a
http://snippet.dhtmlx.com/0e95aa933
http://snippet.dhtmlx.com/5/2c07e9730

Use these methods of yours, and there will be a problem when the hidden Gantt chart page will show exceptions

Hello,
Probably, that issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.
If you can reproduce the issue in the snippets, please, give me the steps.

If you cannot reproduce the issues there, please add your configuration in the following snippets and make sure that the issue is reproduced there. Then, click on the Share button and send me the link.
Or send me a ready demo with all the necessary Javascript and CSS files so that I can reproduce the issue locally.

Is there a way to achieve this freeze column in the resources view?

I’ve just been using your snippets to try and achieve it, but it doesn’t seem to be working for me. I’m likely either missing something or it’s not possible.

Here’s where I’ve gotten to so far: http://snippet.dhtmlx.com/5/7b61267e5

Hello Skoofy,
Recently the dev team suggested a different way of fixing or freezing the grid column.
To freeze a column, it is not necessary to add several grids. Instead, you can use a CSS variable to specify the column position when you scroll the grid. Then you need to attach an event handler to the scrollbar and update the variable each time you scroll the grid:
https://snippet.dhtmlx.com/jbiplpjz
You can use the same approach for the resource grid.
Here is the updated snippet:
http://snippet.dhtmlx.com/5/84a163478

1 Like