views:

108

answers:

1

First of all, hats off to Adam for pulling off this wonderful, well-written calendar plugin!

Now for a a very typical use case. Below is what I want to achieve:

  1. Fetch events (URL added to eventSources) from the server side as JSON data. This is all fine and I have been able to achieve this. The events get rendered properly.

  2. USE CASE in question: Once the fetch is completed and BEFORE the events are rendered and shown on the browser, I want to 'fetch' the initial month/date to show to the end user. I was thinking of a separate AJAX request to fetch the timing details from the server side and then use 'gotoDate' to switch the view's date.

The reason for this specific requirement, being that that the end user would like to see all the events and initial view w.r.t the server time. In our application it is possible that the client and the server box are not at all sync'd w.r.t time.

Unfortunately, as yet I am not able to locate any callback method that gets invoked once the event fetch (all relevant events) is complete and 'before' the events get rendered on the view.

Any help here will be appreciated. Please let me know if any further info is required.

Thanks, Mohit

+1  A: 

"events" - can process a single event source, this could be an array / JSON feed or function.

"eventSources" - is similar except that it expects multiple event sources, these can also be an array of arrays/functions/JSON feeds (anything that the events option would take).

To process the data before it is rendered I expect you could use a function to do some post processing after you have fetched your data with an AJAX request. See e.g.:

http://arshaw.com/fullcalendar/docs/event_data/events_function/

Mark McLaren
@mark That helped a lot. So now i am using the event function as explained in the above URL you have mentioned. Once the request returns success, i call the callback method, and also fire another AJAX request to fetch server time. Once the second request completes, i switch to that (server's) specific date.Works like a charm. A bit of error handling and stuff.... and i will be done for the day! Thanks to you..... ;-)
arcamax