Callback hook for events returned by ajax

WordPress Event Management, Calendars & Registration Forums General Question Callback hook for events returned by ajax

This topic contains 2 replies, has 2 voices, and was last updated by  Geoff Pimlatt 9 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12445

    Hello Stephen,

    Not too complicated, this question. (ahem.)

    Is there a programmatic way to tell the events have been returned to the calendar? I was hoping fire off a JavaScript function after events are rendered, but I haven’t been able to find any sort of trigger to hook into.

    I’ve noticed you have a few triggers throughout your code (on push and pop loading, for example), but I have assumed they are meant for your internal use.

    Turrah!

    Paul

    Geoff Pimlatt
    #12471

    Hi Geoff,

    Are you referring to the javascript hooks? These aren’t documented anyway, however, they are largely safe to use as Pro uses them to modify the behaviour of the calendar (e.g. to add city/country filters).

    While the filter eventorganiser.fullcalendar_render_event runs whenever an event is rendered on the calendar, it doesn’t give you the opportunity to actually edit the event properties, but would allow you to determine if the event appears on the calendar… But this doesn’t tell you when the calendar has finished loading. This does exist (http://fullcalendar.io/docs1/event_rendering/eventAfterAllRender/) but is not exposed by Event Organiser, so using it would involve editing the plug-in (not recommended as your changes will be lost when you update).

    Stephen Harris
    #12641

    Hi Stephen!

    Just a quick update to this. Found the eventorganiser.fullcalendar_render_event hooks and they worked perfectly for what we were trying to do.

    I just wanted to run some JS once events had been returned by the PHP code, so knowing the first event was being rendered to the calendar was perfect, as by that point the AJAX call has ended.

    We also used the event information to build a little mobile event list under the calendar (hidden on larger screens, revealed on smaller ones) that would work for phones, so we never needed to modify the events — just knowing about them was enough.

    Anyways, thanks for all the help! Really happy the way things have gone!

    Paul

    Geoff Pimlatt
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.