Hello,
I’ve overridden the event text with code like this:
scheduler.templates.event_text=function(start,end,event){
return "<b>" + event.customer_name +"</b><br>"+"("+event.service_description + ")";
}
My issue is that if I don’t trigger a reload of the events from the server after an event is updated (onAfterLightbox), the event text will show as undefined. So, I added:
scheduler.attachEvent("onAfterLightbox",function(event_id, event_object){
scheduler.clearAll();
scheduler.load("/events/records?ts=" + (new Date()).valueOf());
return true;
});
The issue I’m now having is that depending on how quickly the onAfterLightbox fires and how quickly the load event occurs, the new event may not have been committed to the database yet, so it doesn’t appear. (It’s VERY intermittent - that database update only takes a few milliseconds, but it happens often enough that I’d worry about a user thinking the record hadn’t saved.)
I really don’t want to kludge this by introducing some kind of sleep/wait type loop to give the database enough time to refresh. Is there a better way where I can either dynamically update the new event with the correct text (so I don’t have to query the database at all after an event is added/updated) or make the onAfterLightbox behavior synchronous somehow with adding the record (so I can be guaranteed the record is saved before onAfterLightbox fire)?
Thanks,
Chris