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

Using DayPilot.Scheduler.options.update(), all events disappear

Asked by Mauricio Farinelli
8 years ago.

After updated DayPilot to last version (v8.2.2130) in our application, we just realized the we could not use DayPilot.Scheduler.options.update() anymore.
When using this method, all our events disappear.

I was debugging it and I think it could be a problem in DayPilot code.
That is because using , it calls postponedUpdate.request(options);
Inside this method, we call postponedUpdate.doit();
Inside doit() method, I found this code:
// partial update, only selected parameters are supported
// may need a different approach
if (options.events) {
calendar.events.list = options.events;
calendar._initialized && calendar._update({"eventsOnly": true});
}
If we have events object (that is the daypilot event object containing many methods and list array with all events)
We affect calendar.events.list = options.events, then it is not an array anymore, so there is no events reloaded in daypilot anymore.

Am I missing something or it is really an issue that should be fixed in DayPilot

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

There are two ways to update events:

dp.events.list = [ ... ];
dp.update();

Since build 1749 it's also possible to replace it with a single call:

dp.update({ events: [ ... ]});

Note that in this case it's not events.list but just events (to make it easier to specify it).

If you don't want to change the event set just call .update() without parameters:

dp.update();

It it doesn't work as expect could you please post the your .update() call?

Comment posted by Mauricio Farinelli
8 years ago.

Thanks,
We just changed our call to update, giving { events: [ ... ]} as param, and it works again

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