数据之Event Source Object

优质
小牛编辑
123浏览
2023-12-01

“event source”是提供的给日程表日程数据的源头,可以是你定义的一个数组,一个函数,一个返回json的接口,或者google calendar。

数组类型:

{
    events: [
        {
            title: 'Event1',
            start: '2011-04-04'
        },
        {
            title: 'Event2',
            start: '2011-05-05'
        }
        // etc...
    ],
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
}

函数类型:

{
    events: function(start, end, callback) {
        // ...
    },
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
}

json接口:

{
    url: '/myfeed.php',
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
}

google calendar:

{
    url: 'http://www.google.com/your_feed_url/',
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
}

event source 的可用设置(统一设置此event source下的每个event object):

id

设置此Event Source下所有Event Object的 color 属性

backgroundColor

Event ObjectbackgroundColor 属性

borderColor

Event ObjectborderColor 属性

textColor

Event ObjecttextColor 属性

className

Event ObjectclassName 属性

editable

Event Objecteditable 属性

startEditable

Event Object startEditable 属性

durationEditable

Event ObjectdurationEditable 属性

allDayDefault

ignoreTimezone

eventTransform

官方英文文档:http://arshaw.com/fullcalendar/docs/event_data/Event_Source_Object/