question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

firing event-click for bg events

See original GitHub issue

Originally reported on Google Code with ID 2543

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);    
   },
   ...
});

Reported by matiasnu on 2015-07-07 11:12:47

Imported with 1 stars.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:9
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

7reactions
saimAbdullahcommented, Apr 18, 2019

I am using the v4 latest release till date but still, it is not firing for background event @arshaw my event data is as follows

{“id”:314.51044554580886, “title”:“blocked”, “start”:“2019-04-13T09:00:00+05:00”, “end”:“2019-04-14T08:00:00+05:00”, “event_source”:“custom”, “allDay”:false, “color”:“gray”, “rendering”:“background”}

and event click code is as follows: eventClick: function (info) { debugger info.jsEvent.preventDefault(); } above thing works for normal event but not for background event

4reactions
massmediagroup-49commented, Mar 30, 2018

@arshaw, Is it possible to implement this feature in short term? It will be very useful for simple booking/blocking system.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fullCalendar eventClick not fired - Stack Overflow
I'm using fullcalendar in an app. I want to change cell background color by clicking on cell, but ...
Read more >
MouseEvent - Web APIs | MDN
Chrome Edge MouseEvent Full support. Chrome1. Toggle history Full support. Edge12. To... MouseEvent() constructor Full support. Chrome26. Toggle history Full support. Edge12. To... altKey Full support....
Read more >
chart.events.click | highcharts API Reference
Fires when clicking on the plot background. One parameter, event , is passed to the function, containing common event information. Information on the...
Read more >
HTML Button onclick – JavaScript Click Event Tutorial
Buttons, on the other hand, are usually manipulated by JavaScript events so they can trigger certain functionality. In this tutorial, we are ...
Read more >
popover events doesn't trigger eventClick function on ...
following is our LWC implementation. HTML Code : <template> <div style="background:#ffffff;" class="slds-grid" > <div class ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found