dj100
August 6, 2013, 8:25am
#1
Is there a way to remove an event from calendar but without making an ajax call?
My custom code deletes series of events at the same time, and when I call
scheduler.deleteEvent(evnt.id);
after events already removed on the server by my code, it makes another ajax-call to my webserver. And it is not just a single event, but dozens…
I just want to remove events from calendar, without making any ajax-calls.
You can use code like
dp.ignore(function(){
//all code in this block, will not trigger data saving operations
scheduler.deleteEvent(evnt.id);
});
dj100
August 6, 2013, 10:31am
#3
I tried this code, but now it doesn’t delete my events at all (still visible on scheduler) and I don’t see any errors. It seems it just not doing anything after I put delete inside ignore function.
dj100
August 6, 2013, 11:36am
#4
I changed your code to this:
dp.ignore(scheduler.deleteEvent(value.id));
and then it works. But does it make any difference if I place it in a second function?
There are two ways how you can handle event deleting.
If you do want to have automatica ajax calls to the server side. Just use deleteEvent API
scheduler.deleteEvent(id);
If you need not automatic calls ( you are handling deleting through some custom code ) , you can place the code in dp.ignore call
dp.ignore(function(){
//all code in this block, will not trigger data saving operations
scheduler.deleteEvent(evnt.id);
});
If you have some third behavior in mind - please describe it, as it is not clear.