重点:多数据源的处理
//加载日志控件
function CreateCanldar() {
$('#calendar').fullCalendar({
theme: true,
editable: true,
buttonText: {
prev: '昨天',
next: '明天',
prevYear: '去年',
nextYear: '明年',
today: '今天',
month: '月',
week: '周',
day: '日'
},
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月',
'八月', '九月', '十月', '十一月', '十二月'],
dayNamesShort: ['星期日', '星期一', '星期二', '星期三',
'星期四', '星期五', '星期六'],
eventSources: [
{
events: function (start, end, callback) {
var node = $("#reply_tree").tree("getSelected");
if (node) {
$('#reply_tree').fullCalendar('destroy');
var employee = node.id;
//加载人员的日志
LoadWorkLog(employee, function (events) {
callback(events);
});
}
}
},
{
events: function (start, end, callback) {
var node = $("#reply_tree").tree("getSelected");
if (node) {
$('#reply_tree').fullCalendar('destroy');
var employee = node.id;
//加载人员的被批复信息
LoadWorkReply(employee, function (events) {
callback(events);
});
}
}
}
],
dayClick: function (date, allDay, jsEvent, view) {
},
eventClick: function (calEvent, jsEvent, view) {
if (calEvent.calType == "reply") {
}
else if (calEvent.calType == "log") {
AddReply(calEvent.id, calEvent.start);
}
},
eventMouseover: function (calEvent, jsEvent, view) {
$(".fc-event-inner").tipTip({
content: calEvent.description,
maxWidth: "auto",
edgeOffset: 5,
defaultPosition: 'right'
});
}
});
}