search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

args.loaded is not a function

Asked by Anonymous
1 year ago.

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)

Answer posted by Dan Letecky [DayPilot]
1 year ago.

In version 2023.1.5508, asynchronous processing of onEventDelete is not supported.

It is now available in the latest sandbox build (2023.1.5525+).

See also:
https://release.daypilot.org/changes/js/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.