Skip to content
Advertisement

How to (sort of) add code to fullcalendar’s renderEvents handler?

I’m using fullcalendar 1.6.3 along with Drupal 7 (thus the need, for now, to be back on 1.6.3). I have some code that I’d like to run every time the view of my calendar changes (via ajax requests) — forward or backward in time, or between month/week/day view.

Based on some tests, I could do this by hacking the source for renderEvents:

JavaScript

but that would of course be Wrong. Unfortunately, I can’t figure out any other way to do it, probably because of some obvious gap in my Javascript knowledge. I tried setting up an event handler on eventAfterAllRender:

JavaScript

but that (for me) only runs on page load, not after the ajax events.

This is probably more of a Javascript question than a fullcalendar question, but is there any advice out there? I’m really trying to not hack core; thanks!

Advertisement

Answer

According to the documentation eventAfterAllRender is a callback, so you can do this:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement