Bryan Apilada
Bryan Apilada

Reputation: 31

Edit event on click in fullcalendar

I was wondering if its possible to show a modal as you click an event in fullcalendar? Where the modal contains all the information of the event and you can edit it. I do know how to show a modal when an event is selected but I can't figure out how do you pass the events id and append it to the modal. I badly need your help, I'm still a newbie in web development so if you could show or explain how and what to do with this. :)

  eventclick: function(){
                $('#editevent').modal('show');

        },

Upvotes: 0

Views: 4552

Answers (1)

Mario Levrero
Mario Levrero

Reputation: 3367

You need to get the eventClick callback method, and work with the first parameter, that is the event you have click.

$('#calendar').fullCalendar({
    eventClick: function(event, jsEvent, view) {
       //Here you can call your method to open your modal.
       //As I don't know your method, I will assume is called 'openModal', that receives an id as a parameter.
       openModal(event.id);
    }
});

Upvotes: 1

Related Questions