我有FullCalendar
(1.5.1 版)在.net
网络表单应用程序中完美运行。我正在尝试在我的新asp.net-mvc
应用程序中部署 1.5.3 版。出于某种原因,我无法在动态提供事件时显示这些事件。
我必须完全控制每个事件(颜色、边框、属性等),并且我正在传递一个JSON
包含所有相关细节的字符串。如果我手动输入JSON
结果events:
,它会按预期显示。但是当我尝试动态设置它时,我什么也得不到。
对于简单的测试,我在数据调用中硬编码了开始和结束时间段,如下所述:
$.ajax({
url: rootUrl + "../Schedule/GetCal?&start=1341129400&end=1344146400",
type: 'POST'
}).success(function(data){
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
titleFormat: { day: '' },
defaultView: _thisView,
events: [data]
});
以下是data
从 Chrome 复制的值:
{id:"5BFAA9C3-9437-49B0-A657-5DA47CDEA409",projectId:"5BFAA9C3-9437-49B0-A657-5DA47CDEA409",title:"Orem City Parking Lot",start:"2012-07-11",end:"",allDay:"true",type:"goal",textColor:"white",backgroundColor:"green",borderColor:"black",crew:""},
{id:"33910A42-C5F0-42FA-AB36-C315BDDAF964",projectId:"33910A42-C5F0-42FA-AB36-C315BDDAF964",title:"Thanksgiving Point - Buster",start:"2012-07-28",end:"",allDay:"true",type:"goal",textColor:"white",backgroundColor:"green",borderColor:"black",crew:""}
如果我采用相同的信息并将原始调用更改为以下内容:
$.ajax({
url: rootUrl + "../Schedule/GetCal?&start=1341129400&end=1344146400",
type: 'POST'
}).success(function(data){
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
titleFormat: { day: '' },
defaultView: _thisView,
events: [
{id:"5BFAA9C3-9437-49B0-A657-5DA47CDEA409",projectId:"5BFAA9C3-9437-49B0-A657-5DA47CDEA409",title:"Orem City Parking Lot",start:"2012-07-11",end:"",allDay:"true",type:"goal",textColor:"white",backgroundColor:"green",borderColor:"black",crew:""},
{id:"33910A42-C5F0-42FA-AB36-C315BDDAF964",projectId:"33910A42-C5F0-42FA-AB36-C315BDDAF964",title:"Thanksgiving Point - Buster",start:"2012-07-28",end:"",allDay:"true",type:"goal",textColor:"white",backgroundColor:"green",borderColor:"black",crew:""}
]
});
一切都按预期显示。
为什么手动设置时有效,而动态设置无效?我错过了什么?