delete all events. clearAll()?


I want to implement the following:
When i delete an event in scheduler (or edit/move…), an sql-proc is calles (via ajax) to delete/alter the event in database. When something goes wrong, i want to have a state in the local scheduler that reflects the databases state.

So wat I do now if the ajax call returns with an error is the following:
I call scheduler.clearAll(), reinitialize some settings, add events etc and then I call
and scheduler.load();
to repopulate data.
But there are some issues.
What is the recommended way to archive this goal?

Is it save to just call scheduler.load() instead?
Will it remove events that are in lokal scheduler but not in database?
If not, is there a function to just delete all the events but keep other settings intact?

Thank you,

scheduler.clearAll() scheduler.load(url)

This will work as necessary in your case, events will be removed on client side only ( without saving in DB ) and new state will be loaded.

And I do not have to reinitialize all the other settings, templates, events?
clearAll() clears allEvents and nothing else?

It seems at least the views have to be reinstalled as well!?

Actually you need not do any other steps, clearAll will remove all events, but all settings and view will stay in place, load command will reload events and render new data.

So those two commands must be enough.