adesigns / calendar-bundle

This bundle allows you to integrate the jQuery FullCalendar plugin into your Symfony2 application.
MIT License
97 stars 60 forks source link

Adding parameters via JS causes multiple /fc-load-event calls #31

Closed groobo closed 9 years ago

groobo commented 9 years ago

Following your example with adding filters - added the JS to the twig template and it passes my parameters to the listener OK - great.

However, I have noticed that when the JS with the extra params is present in the template, the /fc-load-events is now called twice - first with my parameters, then without.

Is there something I have missed?

groobo commented 9 years ago

My bad - haven't noticed that the calendar-settings.js has also been initially placed into the main template and therefore executed twice.

However, is there a way i can set the parameters in my view and keep the settings code + the call in the main template? This seems more like JS question / tip request.

mikeyudin commented 9 years ago

I'd suggest creating a custom calendar-settings.js, using the original as the template, and then modify as necessary. Inline javascript in your view is not a recommended practice.