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

Calendar refresh - hotel reservation

Asked by Anonymous
4 years ago.

Hi!
Is there any function for automatic refresh of the calendar?
I try to put setTimeout, location.reload in function loadEvents(). Nothing seems to work.

If yes, lets say I am editing reservation and page reloads. Will it cancel editing table or,
it will be unaffected?
Thanks

Comment posted by Anonymous
4 years ago.

So I found this code working :
function(data) {
dp.events.list = data;
dp.update();
window.setTimeout(function(){location.reload()},3000);
}

But of course it will close editing window/table. Is there any other solution, how to refresh/update data from database without closing this window?

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

You can use the built-in autorefresh feature:
https://doc.daypilot.org/scheduler/autorefresh/

It will fire onAutoRefresh event in the specified interval. The execution is paused during drag and drop operations.

In the event handler you can update the scheduler events using .update():

dp.onAutoRefresh = function(args) {
  loadEvents();
};
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.