Add/update event then reload

Hello,

I’m trying to configure the scheduler but i can’t solve one little problem: I would like to update the scheduler whithout reloading the whole page. I have read that these 2 lines could do this:

scheduler.clearAll();
scheduler.load(“events.php”);

So can someone tell me what’s the problem with the following instruction:

scheduler.attachEvent(“onAfterLightbox”,function(id){
scheduler.clearAll();
scheduler.load(“events.php”);
});

The error is about ‘this.getEvent(…)’ which is null or not an object

I also tried with onEventSave…no success

Has someone a solution for me?

Thanks in advance for your help

Try to use

scheduler.attachEvent("onAfterLightbox",function(id){ setTimeout(function(){ scheduler.clearAll(); scheduler.load("events.php"); },1); });

Beware , that if you are using data-saving by connector, it still may not work, because after lightbox closing, async. data saving process is started and it may throw an error if you clearing events before response about data saving is received from server. (“onFullSync” event of dataprocessor can be used to catch the moment, when data can be safely reloaded )