Hello,
I am working on an Angular project and I have upgraded to version 6.0.1 of DHTMLX. I want to implement the desctuctor in order to close properly a modal with a scheduler.
I implement my scheduler in ngOnInit function.
ngOnInit(): void {
this.scheduler = this.scheduler = Scheduler.getSchedulerInstance();
}
ngOnDestroy(): void {
this.scheduler.destructor();
this.scheduler = null;
}
But, in the destructor function, the following error occurs.
Why this error occus at the destruction of the component, on which a scheduler is present ?
Perhaps, it’s necessary to implement and delete the dataProcesor. I think I don’t need DataProcessor. I use events like below with a attachEvent.
this.scheduler.attachEvent('onMouseMove', (id, e) => {
const tooltip = (this.scheduler as any).dhtmlXTooltip;
if (id) {
const eventObj = this.scheduler.getEvent(id);
const text = this._contentTooltips(eventObj);
tooltip.delay(tooltip.show, tooltip, [e, text]);
}
}, null);
In doubt, I have tried to add this in destructor, but it’s doesn’t working too.
this.attachedEvents.forEach((id: string) => {
this.scheduler.detachEvent(id);
});
this.scheduler.DataProcessor = null;
If it’s necessary to implement DataProcessor, in the documentation following, there is a lack a definition for CalendarEventService. How we are supposed to use CalendarEventService ?
https://dhtmlx.com/blog/dhtmlx-scheduler-6-0/
Thank you for your help.
Kind regards,