0
確定即時通訊使用Adam Shaw的FullCalendar及其真正偉大的...我想獲得它的大部分功能。好。我的問題是我不能讓2個事件資源是我的頁面中存儲的window.initial_task_items
和另一個是jquery.ajax函數的靜態JSON數據。JQuery完整日曆不能同時使用ajax事件資源和靜態資源
eventSources: [{
//static events
events: window.initial_task_items},
{ //ajax fetching
events: function(start, end, callback) {
if (window.task_calendar_firstrun == true) {
window.task_calendar_firstrun = false;
}
else if (window.task_calendar_firstrun == false) {
window.AjaxRegistry["gettasks"] = $.ajax({
url: window.cvars.userburl + "gettasks",
type: "GET",
dataType: 'json',
data: {
procdate: new XDate($('#task-full-calendar').fullCalendar('getDate')).toString("yyyy-MM-dd"),
user_hash: window.cvars.acuserhash
},
beforeSend: function() {
},
success: function(rsp) {
$('#task-full-calendar').fullCalendar('removeEvents');
var events = [];
$.each(rsp, function(i, task) {
events.push({
start: task.start,
end: task.end,
allDay: task.allDay,
title: task.title,
color: task.color
});
});
callback(events);
},
error: function(ex) {
alert("error occured");
},
complete: function(obj, rsptype) {
}
});
}
}}]
現在我最近測試了上面的代碼,這不起作用。唯一的工作是ajax請求,當我單擊fullcalendar中的上一個和下一個按鈕時,但靜態JSON中的數據未呈現。
無論如何,我可以使兩個事件資源的工作?
注意: 我想加載我的頁面已經呈現在查看頁面時顯示的月份的任務。