I'm trying to handle onEventDelete asynchronously, using the example https://api.daypilot.org/daypilot-scheduler-oneventresize/
However I get an error "args.loaded is not a function"
This is my code:
dp.onEventDelete = function (args) {
var csrf_data = {};
csrf_data[site.csrf.keys.name] = site.csrf.name;
csrf_data[site.csrf.keys.value] = site.csrf.value;
args.async = true;
DayPilot.Http.ajax({
async: false,
data: csrf_data,
method: 'DELETE',
url: "api/events/e/" + args.e.data.id,
success: function(data) {
dp.message("Deleted");
args.loaded();
},
error: function(err) {
if (err.request.status != 403 ){ dp.message("Delete failed: " + err.request.statusText); }
$("#alerts-page").ufAlerts('destroy');
$("#alerts-page").ufAlerts().ufAlerts('fetch').ufAlerts('render');
args.preventDefault();
args.loaded();
}
});
(Using 2023.1.5508)