I am looking for a solution where I can check the response from my backend (server) when creating/updating/deleting an event on the scheduler. If the backend response is not 200 or some validation error, I would like to delete that event from the scheduler (and notify user that appointment was not scheduled).
Please note that I am using the event store to load all the events and manage CRUD.
Thanks
sample code snippet
eventStore: {
createUrl: '/practice/clinics/'+clinic_id+'/clinic_appointments/events.json',
readUrl: '/practice/clinics/'+clinic_id+'/clinic_appointments/events.json',
updateUrl: '/practice/clinics/'+clinic_id+'/clinic_appointments/update-events.json',
deleteUrl: '/practice/clinics/'+clinic_id+'/clinic_appointments/delete-event.json',
// Load and save automatically
autoLoad: true,
autoCommit: true,
onBeforeCommit: function onBeforeCommit() {
// Make it read only since it only allows one commit at the time
scheduler.readOnly = true;
},
onCommit: function onCommit() {
scheduler.readOnly = false;
}
}