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

Updating the Navigator with External call to event data

Asked by Jeff Kurzner
4 years ago.

I have successfully retrieved external data into my schedule utilizing

dp.events.load("/loadvgames.php",
    function success(args) {
      dp.message("Events loaded");
    },
    function error(args) {
      dp.message("Loading failed.");
    }
);
dp.init();

However, the navigator does not update the busy days notification. I have tried using the same type of code for nav.events.list and nav.events.list.load("/loadvgames.php"); without success. Is there a similar method to the dp.events.load for the navigator control?

Answer posted by Dan Letecky [DayPilot]
4 years ago.

The Navigator doesn't support events.load() at the moment but you can load the events using update():

var data = [ ... ] ;
nav.update({events: data});

Usually you'll want to reuse the calendar data so the same data doesn't have to be loaded using two HTTP calls. You could do something like this:

dp.events.load("/loadvgames.php",
    function success(args) {
      nav.update({events: args.data});
      dp.message("Events loaded");
    },
    function error(args) {
      dp.message("Loading failed.");
    }
);

Just make sure that /loadvgames.php returns data for the full range displayed by the navigator.

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