reloading scheduler

How reload scheduler so, that actuall view mode and date remained the same?

I tried this

function reloadCalendar() { scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode, date) { scheduler.clearAll(); scheduler.load("/admin/crm/kalendar.script.php?datum="+String(old_date).substr(0, 15)+"&mode="+old_mode); }); scheduler.setCurrentView(new Date(), 'month'); }

this almost works, but after “reload” I can’t change view mode. And via firebug I know that ajax still “loading” even if XML response comes with no problem.

Any idea?
Thanks!


The code is not returning true from the event handler, which blocks default processing, to fix issue you can try to change the code as

scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode, date) { ... return true; });

Thanks for reply!
Is there any way how reload calendar without changing “start” day and view mode? 'Cause function I wrote is little bit useless.

If you mean reloading data in the calendar, you can just use

scheduler.clearAll();
scheduler.load(url);

Above commands will reload only data, current date and mode will stay unchanged.

If you want to reload whole page, while preserving date and mode - check
docs.dhtmlx.com/doku.php?id=dhtm … _in_cookie

scheduler.clearAll(); scheduler.load(url);

I thought that too, but I must send 2 parameters in url - date and mode, so I don’t know how these two parameters before update (load) get.
I’ll try use cookies

How about the next

scheduler.clearAll(); scheduler.load("/admin/crm/kalendar.script.php?datum="+String(scheduler._date).substr(0, 15)+"&mode="+scheduler._mode);