Scheduler loads only once

I am trying to port the scheduler into Servoy, the scheduler displays fine. However, if a reload the page the scheduler is gone.

I read a similar problem related servoy of another user, see the quotes below.

1)" the page with the content from the server, so anything that javascript calendar wrote will be replaced with the initial

s which are empty of the content. "

2)“Actually, the calendar displays the content well now, and I even manage to repopulate it after servoy reset the html

s that contains the content of the calendar generated by javascript in the browser. Here I got help from DHTMLX support team!”

Would like to know what the solution was. Thx

Hello,
if the html markup of the scheduler is reseted by an application, you can try to reinitialize the scheduler in the same container: scheduler.init("scheduler_here")

Also, I think i’ve found the query you reference to, you can try the following code snippet. It should be called each time scheduler markup is replaced. this solution has been provided quite a long ago, and i don’t have a ready Servoy demo, so i can’t check whether it will work. It’s preferable to use scheduler.init if it solves the problem

scheduler._obj = $('.dhx_cal_container')[0]; scheduler._els = []; var els = ['dhx_cal_data', 'dhx_cal_date', 'dhx_cal_header', 'dhx_cal_navline', 'dhx_cal_next_button', 'dhx_cal_prev_button', 'dhx_cal_tab', 'dhx_cal_today_button', 'dhx_multi_day']; for(var i=0; i<els.length; i++){ var el = els[i]; scheduler._els[el]=$("."+el); }; scheduler._els['dhx_cal_tab].removeClass('active'); scheduler.setCurrentView(scheduler.getState().date, scheduler.getState().mode);

The scheduler is initialized on the onLoad event of a form, in Servoy, within a html area, scheduler.init(“scheduler_here”). When the form loads, for the first time, everything is working fine. However, when the form is reloaded then the scheduler is not displayed anymore. I tried your other code snipset, it is not working either. Do you have another alternative?
Thx

Aliaksandr,

thx, I got it working!