Reloading scheduler

I am using the cookie extension, so start date & view are saved in a cookie and those options are reused each time the page is loaded. This works great.

Sometimes I would like to reload the scheduler without reloading the page. Under those circumstances, the original view is loaded (not even the view from the current page load, which was based on the cookie!)

Here is the basic outline of what happens in the code:

function init(){

scheduler.init(id, start, view);
}

//on page load
init();  //loads the view from the cookie - GOOD
//register for some page element
onClick="init()"   //loads the view from the variable view above - BAD

If I omit the variable view in the scheduler.init call, the schedule is loaded for the view ‘week’ (default?) - but everything else behaves as described.

How do I fix this?

Thank you! Happy New Year. :slight_smile:

Hello,

Do you mean you want to reload events or simply refresh/redraw the scheduler?

By no means scheduler.init should be called again, it would cause problems.

If you are setting up some button or element to refresh scheduler when use following code:

scheduler.setCurrentView(); // same mode and date as current // and if you need to reload events scheduler.clearAll(); // delete all current event scheduler.load(your_link_here);
Kind regards,
Ilya

Thank you, now I can reload the calendar to display correct values.

scheduler.clearAll() scheduler.load(data_url);