The first time entering the Gantt page for operation (adding, updating) is normal, and the second time entering the Gantt page for operation, the page is blank
Hello,
I suppose you try to use the destructor
method when you switch to another tab. But you don’t use the getGanttInstance
method to create a new Gantt Instance when you open the tab with Gantt:
https://docs.dhtmlx.com/gantt/api__gantt_destructor.html
If you use Gantt in Angular, React, Vue, or another framework related to node.js, it is expected to use the Gantt Instance approach.
When you open a page/tab/view with Gantt, you need to create a new Gantt instance. When you switch to a different page/tab/view, you need to destroy the Gantt instance:
https://docs.dhtmlx.com/gantt/desktop__multiple_gantts.html#destructorofganttanddataprocessorinstances
The getGanttInstance
method is available only in the Commercial, Enterprise and Ultimate versions. So, if you use the GPL version, this approach won’t work, and you shouldn’t use the destructor
method. Instead, you need to manually reset everything by yourself.
The following article covers the known issues:
https://docs.dhtmlx.com/gantt/desktop__gantt_instance.html
Here are the demos:
Gantt Instance approach:
https://files.dhtmlx.com/30d/f9efce5ac2b5298cb456fff8279fc78d/angular16+GanttInstance.zip
https://files.dhtmlx.com/30d/4f25d33cbc4b19057f40a028577f9410/vue3+gantt-instance+trial_7.1.12.zip
Alternative approach:
https://files.dhtmlx.com/30d/70dabbe7a7b74a5fe8c8aaa1488ea0ee/angular16+gantt_GPL.zip
https://files.dhtmlx.com/30d/c0a7cdde5ff4139e785733d9bfdbc9fb/vue3+gantt-gpl.zip