eventsfullcalendardismissible

how to make a dismissible event in fullcalendar?


Is it possible in fullcalendar to have the same behavior than in bootstrap dismissible alerts for removing an event?

I would like to have the same behavior than in Bootstrap alert in the following example: https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_alerts_fade&stacked=h


Solution

  • element.find('div.fc-title').append("<span id='eventTimes'><i class='fas fa-times'/></span>");
                        element.find("#eventTimes").click(function () {
                            deleteBookingById(event._id);
                            $('.tooltip').remove();
                        });
    

    function deleteBookingById(id) {

                if (confirm('Do you want to remove this booking?')) {
                    // ToDo: C# delete part
                    $('#calendar').fullCalendar('removeEvents', id);
                    setNormalBehavior();
                }
    
        }