Cannot change the column label on gantt

I’m stuck on this already for how many days but I can’t find a solution. I need to change the column html on click. I made a custom column that has the dhtmlx gantt open close tree icon that should change to open or close if clicked. I managed to change the column by calling resetLayout but it resets the scroll state and the column states like width, etc and also the resizers. I need it to have the same function as gantt.render() where it only refreshes the whole gantt and not reset anything. I tried to change the classlist of the html but it wont update.

https://snippet.dhtmlx.com/522ds70h
https://snippet.dhtmlx.com/1f1mqzj5

PS. It would be good if this column can be added in the future to collapse/expand all tasks instead of custom implementation.

Hello Cairo,
If you change the layout configuration, you need to use the resetLayout or init method to repaint the changes. There is no way to change how it works.

If you want to preserve the sizes and scroll state, you need to save them before applying the changes and restore them after that.
Here is an example of how it can be implemented for the scroll position:

If you want to change the label of the main grid columns, you can modify the column configuration in the gantt.config.columns parameter, then it is enough to use the render method:
https://snippet.dhtmlx.com/6q2m2leh

For the resource grid, you need to use the getLayoutView method to obtain the existing layout cell:
https://docs.dhtmlx.com/gantt/api__gantt_getlayoutview.html

Then you can use the $getConfig method and modify the columns array:

gantt.getLayoutView("resourceGrid").$getConfig().columns[0].label = "New Label"

Here is an example:
https://snippet.dhtmlx.com/18hf08fk

Also there are no plans to add a column to collapse or expand all tasks.