Need help on updating scheduler!!!

Hi Team,

I wanted to update/refresh all scheduler after user add/delete/edit events evey time, but I set “scheduler.config.update_render=true” it didn’t work anymore.

In this case, I had multi-users to use one server (DB).

Any idea on this would be helpful for me.

Thanks,

Best wishes,

Jundong

“update_render” is related to client side rendering and will not affect DB operations or multi-user usage.

There is no build in solution to sync changes in calendar in real time ( except of full data reloading )

Hi Stanislav

Thanks for your reply.

But how can I triger the full data reload funtion after any event updated?

Best wishes,

Judo

To reload data you can call

scheduler.clearAll()
scheduler.load(url)

But in multi-user system the task is more complicated - other users need to receive signal , that some data need to be updated. Which will require implementing of long-polling|comet data loading, which is not a simple task.

i am working on this thread, viewtopic.php?f=6&t=13677, thanks for the replies, scheduler got a good look now.

i have a ‘reload’ button which is out side the scheduler render area (‘scheduler_here’ div) , i want to reload the scheduler data when i click on the button,

searching through out the forum, i tried using:

$("#reloadBtn").click(function(){
scheduler.clearAll();
scheduler.load(myUrl);
return true;
});

My firebug console shows request successfully completed & xml is loaded correctly, but when i see a details of the events, i see no changes at all. The context is, i am trying to add events type with a different pop up & this needs to be updated in scheduler lightbox select box as i add new events type.

will be waiting for your response.

It possible that problem is in caching , you can try to add random element to the URL of data feed, or add the next options ( scheduler 2.2 )

scheduler.config.prevent_cache = true;

i added prevent cache line in the first init and also in the reload function ( scheduler.config.prevent_cache = true;) and further passed random variable to scheduler.load

$("#reloadBtn").click(function(){
scheduler.config.prevent_cache = true;
var dat = new Date().getTime();
scheduler.clearAll();
scheduler.load(“codebase/events.php?user=<?php echo $userId;?>&uid=”+scheduler.uid()+"&tm="+dat)
return true;
});


still i am not getting the refreshed scheduler view. Every time i press the the reload button, i see the xml loaded is the updated one but the scheduler lightbox is not updated with the new values.

i have no options left now than to reload the whole page after every update or reload the whole display with ajax. any suggestions please??

. Every time i press the the reload button, i see the xml loaded is the updated one but the scheduler lightbox is not updated with the new values.

You are loading new data and opening lightbox after that, right? Because already opened lightbox will not be populated with new data automatically.

You can check the attached sample.
1276850842.zip (43.2 KB)

Stanislav, i now completely understand what you are saying, this is exactly the case i am facing now.

Because already opened lightbox will not be populated with new data automatically.

  • yeah, i tried on what you said,

when i first add data using pop up and reload the scheduler with reload button, after that if i open the lightbox, it’s populated correctly.

but when i first open lightbox, close it, then add data with pop up and re-open the lightbox after reload, the lightbox is not updated.

You are loading new data and opening lightbox after that, right?
you see, loading data to the values for select box is done in separate pop ups, with ajax call. i think this will be completely on user side whether he will open scheduler lightbox before adding the data or after adding them. how would i address it ?

Thanks for you support.

As far as I can understood - inside lightbox you have some sections which can be populated | changed by some other logic, and after changing data in this collection you still see old values in lightbox, right?

Liughtbox is rendered only once, during first opening, so it will not reload it list connections if they were updated. You can add the next line ( when lightbox need to be updated )

scheduler._lightbox = null;

it will force re-rendering of lightbox, so it will use new collections for rendering.

Thank you both of you, I got a big help on this topic during your discussion.

Best wishes,

Judo520

Final code is now just 4 lines inside click function:

$("#reloadBtn").click(function(){
scheduler._lightbox = null;
scheduler.clearAll();
scheduler.load(myUrl);
return true;
});

thanks a lot. it works now.