When i remove a section, I want to find and remove all corresponding events from scheduler.
Now it seems (according to the API-Help) the only solution would be to get all events by
scheduler.getEvents(reallyEarlyDate, reallyLateDate);
and then using a loop to find and deleteEvent() all those with a given section_id individually.
That seems possible but clumsy. Is there a recommended way to do it?
Also: If I do it as above, the “onBeforeEventDelete”-Event would be fired.
I use the trash-symbol (event-delete) together with this event to delete the event from database, so in the above szenario all that sections events would be deleted, when all I want to archive is to keep that section and all its events from beeing displayed in scheduler (but still have them in database).
What view are you using? If it is units view then I can provide updated version where you can easily modify sections and events won’t be rendered if their section is not present.
Sorry, I didn’t quite get it.
As for solution:
You can scheduler.clearAll() events and then load only the required ones. So ids of the sections should be passed in the call and server side should use them in the query. Requires editing server side code.
You can loop through scheduler._events array and delete all events with specified section_id. After that re-render current view using scheduler.setCurrentView(scheduler.getState().date, scheduler.getState().mode). Though scheduler._event is not a public API.