Fullcalendar - Can we add custom data to our event Json Data?

前端 未结 5 1155
逝去的感伤
逝去的感伤 2021-01-11 19:55

I want to send a type in my Event Json Response.

Here is my code:

$(\'#calendar\').fullCalendar({

eventSources: [ 

{\"id\":\"46_l\",\"title\":\"Cus         


        
5条回答
  •  没有蜡笔的小新
    2021-01-11 21:01

    As per the documentation:

    Non-standard Fields

    In addition to the fields above, you may also include your own non-standard fields in each Event Object. FullCalendar will not modify or delete these fields. For example, developers often include a description field for use in callbacks such as eventRender.

    Example:

    $('#calendar').fullCalendar({
        events: [
            {
                title: 'My Event',
                start: '2010-01-01',
                type: 1 // Custom field
            }
        ],
        eventRender: function(event, element) {
            console.log(event.type); // Writes "1"
        }
    });
    

提交回复
热议问题