如何在jQuery插件fullCalendar中使用多个源代码? [英] How do I use multiple sources with the jQuery plugin fullCalendar?

查看:109
本文介绍了如何在jQuery插件fullCalendar中使用多个源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个功能完整的日历 http://arshaw.com/fullcalendar/ ,用于检索单个来自Google日历的事件如下所示:

I've got a functional fullCalendar http://arshaw.com/fullcalendar/ working retrieving a single source from Google Calendar for the events like so:

$('#calendar').fullCalendar({

   events: $.fullCalendar.gcalFeed(
      "http://www.google.com/calendar/feeds/etc",   // feed URL
      { className: 'gcal-events' }                  // optional options
   )

     });

然而,我的挑战是要有多个Feed。fullCalendar文档说:

My challenge is however to have multiple feeds coming in. The fullCalendar documentation says:

eventSources:Array
与'events'选项类似,但可以指定多个来源。例如,可以指定一个JSON URL数组,一个自定义函数数组,一个硬编码事件数组数组或者任何组合。

eventSources: Array Similar to the 'events' options, except one may specify multiple sources. For example, one may specify an array of JSON URL’s, an array of custom functions, an array of hardcoded event arrays, or any combination.

但是没有示例和所以这个JSON新手在这里有点卡住了。

But there is no example and so this JSON newbie here is a little bit stuck.

有什么需要使用eventSources和一个feed数组的$ $ $ b

Any ideas on what it would need to use eventSources and an array of the feeds?

推荐答案

在这里找到解决方案;
http://code.google.com / p / fullcalendar / issues / detail?id = 192& q = eventSources

Found solution here; http://code.google.com/p/fullcalendar/issues/detail?id=192&q=eventSources

eventSources:
[
    'msCal.txt', // location of Cal JSON script
    'msLogBook.txt', // location of LogBook JSON object
    'msEvents.txt' //location of the Events JSON object
]

回想起来非常简单。以下是我的测试页面;

Painfully simple in retrospect. The following is working on my test page;

eventSources:
[
    $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/en.australian%23holiday%40group.v.calendar.google.com/public/basic'),
    $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),
    $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/en.indonesian%23holiday%40group.v.calendar.google.com/public/basic')
],  

这篇关于如何在jQuery插件fullCalendar中使用多个源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆