我正在嘗試使用json將事件傳遞到FullCalendar並且它們不顯示。有誰知道我的JSON的結構是否有問題?來自cfc文件的json feed在FullCalendar中不顯示
CFC文件:
<cfcomponent>
<cfsetting showDebugOutput='No'>
<cffunction access='remote' name='getEvents' >
<cfset var events = [{'id'='10','title'='Urlaub','start'='2014-11-14 07:30:30','end'='2014-11-14 08:30:30'}]>
<cfreturn serializeJSON(events)>
</cffunction>
</cfcomponent>
CFM文件:
eventSources:
[
{
url: 'events_for_calendar_test.cfc?method=getEvents',
color: 'yellow',
textColor: 'black'
}
]
JSON飼料被傳遞:
[{ 「開始」:「2014年11月14日7時三十○分30秒「,」end「:」2014-11-14 08:30:30「,」id「:」10「,」title「:」Urlaub「}]
你有沒有嘗試了一些不同的日期格式?我是fullcalendar新手,但我看到的各種示例經常使用'yyyy-dd-mm hh:mm:ss'格式。 – 2014-11-14 16:32:00
是的我也試過這種日期格式。我可以在我的網絡流量中看到json,並且看不到任何會弄亂它的內容:[{「start」:「2014-11-14 07:30:30」,「end」:「2014-11-14 08:30:30「,」id「:」10「,」title「:」Urlaub「}] – tdh 2014-11-14 16:53:19
語法對我來說確實很好。有可能你有一個無效或重複的ID? – 2014-11-14 17:15:45