Javascript fullcalendar.io一个提要中包含多个eventsources
在fullcalendar中,可以定义多个提要Javascript fullcalendar.io一个提要中包含多个eventsources,javascript,fullcalendar,Javascript,Fullcalendar,在fullcalendar中,可以定义多个提要 $('#calendar').fullCalendar({ eventSources: [ // your event source { url: '/myfeed1', color: 'yellow' }, { url: '/myfeed2', color: 'red'
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
url: '/myfeed1',
color: 'yellow'
},
{
url: '/myfeed2',
color: 'red'
}
]
});
可以在一个json提要中定义多个源吗
我的目标是这样的:
$('#calendar').fullCalendar({
eventSources: '/multiplefeedsineone'
});
Multiplefeedsinone将返回:
{
events: [
{
title: 'EventFromFeed1_1',
start: '2011-04-04'
},
{
title: 'EventFromFeed1_2',
start: '2011-05-05'
}
],
color: 'yellow'
},
{
events: [
{
title: 'EventFromFeed2_1',
start: '2011-04-04'
},
{
title: 'EventFromFeed2_2',
start: '2011-05-05'
}
],
color: 'red'
}
如果使用单个源URL 您不能传递颜色和文本颜色选项,也不能在后端聚合多个提要。来自后端的结果应与此类似:
[
{
title: 'event1',
start: '2010-01-01',
color: 'yellow',
},
{
title: 'event1',
start: '2010-01-01',
color: 'red',
}
]
这样,我再次获得所有事件的一个提要—所有黄色事件。我想在一个请求中获取不同的提要,在一个请求中获取所有红色和黄色事件,并从后端设置颜色。我确实可以设置每个事件的颜色。看见
[
{
title: 'event1',
start: '2010-01-01',
color: 'yellow',
},
{
title: 'event1',
start: '2010-01-01',
color: 'red',
}
]