Gantt refresh data and keep tree open/close status


#1

Is there a way to gantt.parse updated json into the gantt chart and keep the status of open/close of parent tasks?

In other words, preserve the tree status on data refresh?


#2

Well I opted to store the id of the task onTaskOpened in localstorage, send that to the server when retrieving updated tasks and set open:true for that specific task in the returned json


#3

Hello,
It happens if you parse the tasks that were in the chart before the parse (or if their IDs match). If you parse other tasks, it won’t affect existing tasks:
http://snippet.dhtmlx.com/a3efa1741
As a workaround, you can use onBeforeParse event handler to save the IDs of the open tasks in an array. After parsing the data you open the tasks from the array:
https://snippet.dhtmlx.com/374b09cb2