Cannot read property 'reset' of undefined

Hi,
I created a gantt chart on one of my components (on my application) and I did this onInit:
gantt.init(…);
gantt.parse();

and did this onDestroy:
gantt.destructor();

When I change to another tab, on my application, and try to get back to the gantt chart, this error appears:

TypeError: Cannot read property ‘reset’ of undefined
at Object.t._reinit (dhtmlxgantt.js:10)
at Object.init (dhtmlxgantt.js:10)
at ProjectPanelPlanChartComponent.push…

Can you help me? Maybe I’m doing something wrong…
Thanks.

Hello Inês,
If you destroy Gantt, you won’t be able to use it again until you reload the page or create a new Gantt instance. The second option is available only in the Enterprise Pro version:
https://docs.dhtmlx.com/gantt/desktop__multiple_gantts.html#destructorofganttanddataprocessorinstances

You can reproduce the issue in the snippet:
http://snippet.dhtmlx.com/f0707b5f7

If you have the Enterprise Pro version, you can use the following command to create a new Gantt instance:

gantt = Gantt.getGanttInstance();

After that, you can initialize Gantt and load the data:

gantt.init("gantt_here");
gantt.parse(<data>);

Here is the snippet:
http://snippet.dhtmlx.com/270f89f88

Hi,
But I only want one instance on my application. I need to pay more?

Thanks.

Hello Inês,
The Standard and commercial Pro versions don’t have the functionality to create a new Gantt instance when Gantt was destroyed.
You are not obligated to buy the Enterprise version to make Gantt work in React.
But in that case, you cannot use the gantt.destroy() command unless you want to refresh the page.
Instead of that, you can use the gantt.clearAll() command to remove all tasks from the chart and manually detach all event handlers.

Hi,
Thanks. I will do that.
Another question, with commercial Pro Version I have access to the “Pro” elements, right?

Thanks.

Hello Inês,
Unfortunately, it is not clear for me which “Pro” elements you mean. Could you clarify that?
You can also check the difference between the Pro and Standard versions in the following article:
https://docs.dhtmlx.com/gantt/desktop__editions_comparison.html

Hello,
I’m referring to this elements, like for example “Projects and Milestones task types, and others…” because I bought the Commercial plan and says that the plan includes PRO edition just if exists.
(https://dhtmlx.com/docs/products/licenses.shtml)

Thanks.

Hello Inês,
Thank you for the clarification.
Yes, the commercial version has Project, Milestone and Custom tasks.
Not all DHTMLX products have the Pro version, and that page is for all products.
Here is the licensing page for DHTMLX Gantt:
https://dhtmlx.com/docs/products/dhtmlxGantt/#licensing

Hi,
Thanks for your support.