Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ludovic on May 28, 2009 08:32
open dhtmlx forum
Refresh DHTMLX scheduler

Hi,

Is there a simple way to refresh events without reloading the whole page?
My goal is to build a shared planning, where events created by one user can be immediatly seen by others.

Thanks in advance, and "bravo" for the amazing work here!

Ludovic.
Answer posted by Alex (support) on May 28, 2009 09:28

Hello, 

You can try to use the following approach to reload only scheduler:

function reload(){
  var events = scheduler._events;
  for (var id in events){
    scheduler.deleteEvent(id);
  }
  scheduler.load("events.xml");
}

Answer posted by Ludovic on May 29, 2009 00:24
Hello,

I'm using a mySQL db to store events, and the call to "scheduler.deleteEvent();" delete them from the db.
I'd like to reload events from the db and render them to the scheduler.

Many thanks,
Ludovic.

Answer posted by ludovic on May 29, 2009 00:37
Hi again,

I have my solution :

function reload(){
  scheduler.clearAll();
  scheduler.load("events.php?uid="+scheduler.uid()+"&ran="+Math.random);
}

Cheers,
Ludovic.

Answer posted by Alex (support) on May 29, 2009 02:25
Hello

Yes, you're right.

In case of using DataProcessor, deleteEvent will send request to the server. So, using clearAll() is more correct.