Error dhtmlxAjax is not defined on exportToPNG function

Hi all,

After updating my dhtmlxGantt to the new dhtmlxGantt 3.2.1 PRO Commercial today, in my function exportToPNG, a javascript error appears stating:

“dhtmlxAjax is not defined”

This error does not appear before I updated my dhtmlxGantt .
I compared the previous version and the current version of dhtmlxGantt and looked through the variables "dhtmlxAjax " in the javascript files. In the previous versions, there were variables "dhtmlxAjax " but in the current version, there are no more variables named "dhtmlxAjax " in the javascript files.

Please help.
Thanks.

Hello,
we’ve confirmed the issue. Seems like it was introduced by the component update 3.2, when some common dhtmlx libraries were updated in a component. We’ll fix it in the nearest time

For now, try adding following snippet to your page, it should fix the issue:if(!window.dhtmlxAjax){ window.dhtmlxAjax = { post: function(url, data, callback){ return dhx4.ajax.post(url, data, callback); }, get: function(url, callback){ return dhx4.ajax.get(url, callback); } }; }

Hi Aliaksandr,

Just tried the code snippet on my page and it is now working fine.
Will implement this on my website.

Thank you very much for the help.
Regards.

Export service was updated as well, so now it must work with latest Gantt 3.2 without need for extra code customization.

Hi Stanislav,

Do you mean the export service on:
export.dhtmlx.com/gantt/api.js

If so, the error still occurs. So I just followed Aliaksandr’s suggestion to add the code snippet on my page.

Thank you so much for your support.
Regards.

Hi,

The update fixed the problem while checking from our side. So I’m not sure why it still not work for you.

Anyway, the above-proposed patch solves the problem as well, so you can use it without any side effects and problems.

Hi Stanislav,

There will be no error if I just use the normal exportToPNG() function, without adding some parameters in the function. But in my system, I add a parameter in the exportToPNG() function, namely header, which defines my preferred font style and font size on the gantt snapshot.

Thank you so much for your support.
Thanks.