How to add multiple classNames in to fullcalendar event object and deleting with one specified class name

fullcalendar, javascript, jquery

Solution

From the documentation:

ClassName: String/Array. Optional. A CSS class (or array of classes) that will be attached to this event's element.

Therefore you should use an array of strings to attach multiple classes to the event.

This should solve your problem:

var eventObject = {
        title: displayText,
        start: item.startDate,
        end : item.endDate,
        allDay: true,
        color: '#BABBBF',
        editable : false,
        className : ["user_block", "bday_block"]
}

Problem

Does anyone know how I can add multiple class names in to one event? Currently my event object looks something like this. ``` var eventObject = { title: displayText, start: item.startDate, end : item.endDate, allDay:true, color: '#BABBBF', editable : false, className : "user_block" } ``` When I tried something like this ``` var eventObject = { title: displayText, start: item.startDate, end : item.endDate, allDay:true, color: '#BABBBF', editable : false, className : "user_block bday_block" }; ``` The following code doesn't seem to excute with normal behaviour where it is suppose to remove all events with the "user_block" class ``` $("#calendar").fullCalendar('removeEvents', function(event) { return event.className == "user_block"; }); ``` Any ideas on how to solve this? Thank you.

Original source