在jQuery FullCalendar中使用多个文件获取事件

Using multiple files for fetching events in jQuery FullCalendar

本文关键字:文件 获取 事件 jQuery FullCalendar      更新时间:2023-09-26

我正在Symfony2站点中实现jQuery FullCalendar,但我需要能够显示来自两个不同来源的事件,并用不同的颜色突出显示它们,以便前端用户能够区分每种类型。

目前,我在日历设置js中使用这段代码从json文件中获取事件:

events:
   {
     url: 'calendarjson/events.json'
   },

这是我的events.json文件,如果有帮助的话:

[{"id":1,"title":"待办事项","description":"已编辑待办事项文本!查看呼叫日志</a>","start":"2015-10-3014:30:00","allDay":0},{"id":2,"title":"测试提醒","说明":"asfsafasfd","开始":"2015-11-1012:00:00","全天":0}]

然而,我需要能够从另一个文件中获取数据,该文件包含删除公司的驱动程序表,这样用户就可以看到接下来会发生什么。

有没有一种方法可以允许日历使用两个不同的json文件来获取事件,并且最好为事件的背景实现不同的颜色?

提前感谢

来自API:

$('#calendar').fullCalendar({
    eventSources: [
        // your event source
        {
            url: '/myfeed.php', // use the `url` property
            color: 'yellow',    // an option!
            textColor: 'black'  // an option!
        },
        {
            url: '/myfeed2.php', // use the `url` property
            color: 'yellow',    // an option!
            textColor: 'black'  // an option!
        }
        // any other sources...
    ]
});

http://fullcalendar.io/docs/event_data/events_json_feed/