How to do with DHX html gantt method?
Hello Foram,
Gantt doesn’t work that way. You cannot update the data only for the specified column.
You can only repaint one row, several rows, or the whole Gantt. For that, you need to use the following methods:
• refreshTask
https://docs.dhtmlx.com/gantt/api__gantt_refreshtask.html
• updateTask
https://docs.dhtmlx.com/gantt/api__gantt_updatetask.html
• refreshData
https://docs.dhtmlx.com/gantt/api__gantt_refreshdata.html
• render
https://docs.dhtmlx.com/gantt/api__gantt_render.html
If you want to modify the properties of a single column in the column configuration, you need to use the refreshData
or render
methods to repaint the changes.
Here are examples:
https://snippet.dhtmlx.com/e516bey9
https://snippet.dhtmlx.com/zfm6jbx7
If you want to modify a specific property of all tasks, you need to manually iterate tasks and modify the property. To do that, you need to use the eachTask
method:
https://docs.dhtmlx.com/gantt/api__gantt_eachtask.html
To repaint the changes only once, you can wrap it with the batchUpdate
method:
https://docs.dhtmlx.com/gantt/api__gantt_batchupdate.html
Here is an example of how it can be implemented:
https://snippet.dhtmlx.com/3eu9wvht