【发布时间】:2011-08-01 20:31:51
【问题描述】:
我正在查看 jquery full calendar 1.5 并且有几个问题。
多源会是什么样子?
jQuery $.ajax options
You can also specify any of the jQuery $.ajax options within the same object! This allows you to easily pass additional parameters to your feed script, as well as listen to ajax callbacks:
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
url: '/myfeed.php',
type: 'POST',
data: {
custom_param1: 'something',
custom_param2: 'somethingelse'
}
error: function() {
alert('there was an error while fetching events!');
},
color: 'yellow', // a non-ajax option
textColor: 'black' // a non-ajax option
}
// any other sources...
]
});
来自:http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/
你会不会只是放一个逗号,然后基本上复制第一个?
我的第二个问题是。我将有一个事件源(因为它们都来自同一个源),但我将在其中有一组事件,每个组需要不同的颜色。
所以我可以拥有这个
Item 1 - group 1 (color red)
Item 2 - group 1 (color red)
Item 3 - group 2 (color green)
Item 4 - group 3 (color black)
现在这些颜色是由用户设置的,所以我永远不会知道第一个颜色组是什么颜色。一位用户可能会将其设置为红色,另一位用户可能会将其设置为蓝色。
所以我认为我需要在每个事件中发送颜色。因此,第 1 项将具有与之关联的颜色,第 2 项将具有与之关联的颜色等等。
如何做到这一点?我想一旦我得到事件回来我需要做点什么。我只是不确定是什么。
谢谢
【问题讨论】:
标签: jquery jquery-plugins fullcalendar