I used back the onTaskOpened and onTaskClosed event to always call the toggle animation. But the behavior is a little weird.
I added _____ so that the text will not be shifted behind the icon, for better visibility
I’m not sure why there is this gap in the grid for Task #2 and Task #5.
Task #2 and Task #5 has already been set to open = false but when it loads, Project #2 icon is expanded. Task #2 and Task #5 should be not expanded?
Click on Task #2 expand icon once, it should toggle and change the icon to the other state, but it does not. However, if I click again, it does toggle.
On fresh load, click on Task #2 icon twice, now the icon will be as such.
Then now click on Task #5, notice that Task #5 icon doesn’t toggle, but instead Task #2 icon toggles.
After changing a task property(the open property in your case), you need to repaint the changes. That can be done by using one of the following commands:
• gantt.updateTask(id)
• gantt.refreshTask(id)
• gantt.render()
• gantt.refreshData()
Not yet, but I’m not using dataProcessor feature but it gave me the idea that I can dynamically fetch the data when needed rather than fetching all together. I can implement that I guess. Thanks.
The snippet you given seem to work perfectly, but when I tried to test it on a sample react app that I did previously - snippet, it didn’t work. I’m not sure if there’s anything that I missed out. The expand/collapse icon wasn’t displayed.
In my snippet, you can click on Task #4 and look at the console, and somehow, the $rendered_type is still task instead of store. Any idea?
And I also noticed that by adding $has_child to the task, I don’t even need to manually set the open state in onTaskOpen and onTaskClose event right?
Hello Joseph,
Yes, the GPL version is the Standard Free version.
There are online links for the version that has all Gantt functionality, we use it to demonstrate all Gantt features. But that Gantt version shouldn’t be used outside the dhtmlx.com domain unless you send us a demo that demonstrates an issue in the Pro version.