Issue 2543: firing event-click for bg events
Status:  ExportedToGithub
Owner: ----
Closed:  Aug 2015
Reported by matiasnu, Jul 7, 2015
In some cases it's useful to detect clicks on background events (not currently supported).

The small fix is divided into two parts;

1) Make sure we connect the seg to the fillSeg by fc-seg data in renderFillSegEls() in Grid.js, just like we do for ordinary event segs. [1 line added]

2) Detect click events on .fc-bgevent-container elements and trigger bgEventClick in a new bindBgSegHandlers method. [1 line + 1 method added]

We could extend the bindSegHandlers method to support bg events too, but the new method felt cleaner since we don't want to resize the background events.

Example;

$('#calendar').fullCalendar({
   header: {
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay'
   },
   defaultView: 'agendaWeek',
   bgEventClick: function(calEvent, jsEvent, view) {
      alert(calEvent.title);	
   },
   ...
});
Jul 7, 2015
#1 matiasnu
Code for this feature is available in my fork: https://github.com/matiaslarsson/fullcalendar

Let me know if I should create a pull request.
Aug 2, 2015
Project Member #2 adamrs...@gmail.com
this isn't supported out of the box? it should be. thanks. might do bgEventClick like you have implemented or find a way to do it with simply eventClick.
Summary: firing event-click for bg events (was: Add a bgEventClick handler for clicks on background events)
Status: Accepted
Labels: Type-Feature
Aug 4, 2015
#3 matiasnu
I agree that an eventclick with an event type (fg or bg) is probably cleaner. Anyway here's the pull request if you decide to use my code: https://github.com/arshaw/fullcalendar/pull/258
Aug 20, 2015
Project Member #4 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2808

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub