How can I rerender gantt chart with the new config values when any of the config value is changed? Currently I’m changing autosize property on a button click but the changes are not reflecting on the gantt chart.
Hello Akhil,
For some settings it is enough to use the gantt.render
method:
https://docs.dhtmlx.com/gantt/api__gantt_render.html
Other settings require Gantt or layout reinitialization. For them, you need to use the gantt.init
or gantt.resetLayout
methods:
https://docs.dhtmlx.com/gantt/api__gantt_init.html
https://docs.dhtmlx.com/gantt/api__gantt_resetlayout.html
For the autosize
config, it is enough to use the gantt.render()
method. However, after you change the parameter, Gantt will modify its container size:
https://snippet.dhtmlx.com/5/fad728c16
When you turn off autosize settings, the container size doesn’t change, so you won’t see the changes. You need to manually reset the width
and height
properties.
Here is an example of how it might be implemented:
http://snippet.dhtmlx.com/5/2609bbda9