我正在尝试FullCalendar
在我的 MVC 应用程序中呈现 (1.5.3),如下所示:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
titleFormat: { day: '' },
defaultView: 'month',
events: "/Schedule/GetCal"
});
生成的JSON
字符串/Schedule/GetCal
如下所示:
{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:""}
它不会在页面上呈现任何事件。但是,当我这样称呼它时:
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
titleFormat: { day: '' },
defaultView: 'month',
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:""}
]
});
它按预期工作。我需要更改JSON
字符串的格式吗?或者,我怎么称呼它?