Incompatibility between dhtmlxScheduler and dhtmlxChart?

Using the latest dhtmlxScheduler (2.3) and dhtmlxChart (3.0), if dhtmlxScheduler is loaded after dhtmlxChart it will completely break dhtmlxChart:

  • dhtmlChart checks if window.dhtmlx exists, if it does not it creates a simple object via window.dhtmlx = {};
  • dhtmlxScheduler seems to rely on older (?) APIs, instead of adding functions on dhtmlx ns, it unconditionally sets dhtmlx to a function to which it adds only an (apparently unused) dhtmlx.extend_api function (which does not exist in dhtmlxchart for what it’s worth

As a result, all the functions dhtmlxchart adds to the dhtmlx namespaces are removed/destroyed, which breaks dhtmlxchart (dhtmlXChart constructor uses a number of functions from the dhtmlx namespace).

This issue seems to solve itself if I simply replace the dhtmlx-setting in common and scheduler by the same call sequence as that in dhtmlxChart (conditionally assigning an object to window.dhtmlx).

Does that seem like the correct solution, or is it likely to pose further issues later on?

Note: since dhtmlxScheduler 2.3 doesn’t ever use the dhtmlx namespace, I think the whole thing could just be removed as well, to no ill effect.

Does that seem like the correct solution, or is it likely to pose further issues later on?
It will not cause any side effects and can be used as stable solution

Thanks for the problem report, we will update code of next version, to prevent such kind of problems in future.

It will not cause any side effects and can be used as stable solution

Thanks. I’ll keep the current band-aid then.

Thanks for the problem report, we will update code of next version, to prevent such kind of problems in future.

Considering the look of the code, I’m guessing chart has already been switched to a more recent API/core or something, and scheduler is just lagging a bit there

Hi,

It seems dhtmlxScheduler has not been fixed for this problem in v3.0

Somehow fix was overwritten by bad code again :frowning:
Correct dhtmlxscheduler.js for version 3.0 is attached.
dhtmlxscheduler.zip (22.9 KB)