How to add multiple cool names to a fullcalendar event object and delete with a single specified class name

Does anyone know how I can add multiple class names to a single 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 does not seem to justify normal behavior when it is supposed to delete 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.

+4
source share
1 answer

From the documentation :

Class Name : String / Array. Optional. The CSS class (or array of classes) that will be attached to this event element.

.

:

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

Source: https://habr.com/ru/post/1547084/


All Articles