0
votes

I have recently been messing around with FullCalendar for my website. The script at the moment uses the Google Calendar API to display the events on FullCalendar as FullCalendar looks nicer. My problem is that the event link (when you click on the event) it redirects to the event on Google Calendar. I managed to prevent it from doing this with this piece of code:

eventRender: function(event, element) {
      element.on('click', function (e) {
    e.preventDefault();
       });
      }

This stops the user from being redirected to Google Calendar. However, I still needed to display some details of the event so I did this piece of code using BootBox.js:

eventClick: function(calEvent, jsEvent, view, event) {
bootbox.alert({ message: '<div> Event Name:'+event.title+'</div>'})
}

However this this piece of code seems to think the event name variable event.title and displays it as undefined. How would I get it to display the required variables? I want to be able to display other variables but am just using event.title for now until the issue is finished.

1

1 Answers

0
votes

This should work:

eventClick: function(calEvent, jsEvent, view) {
bootbox.alert({ message: '<div> Event Name:'+ calEvent.title+'</div>'})
}