FullCalendar的事件功能
我在我的 Asp.Net 1.1 应用程序中使用 Fullcalendar。为了从服务器端获取数据,我使用 Ajaxpro。因此,将事件获取到 Fullcalendar 的代码编写如下:
$calendar.fullCalendar({
editable: true,
selectable: true,
theme: true,
height: 545,
defaultView: 'agendaWeek',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: function(start, end, callback) {
dss.user_activity.getActivities(function(doc) {
var events = [];
var obj = jQuery.parseJSON(doc.value);
$(obj.Head).each(function() {
events.push({
id: this.SQ_USER_ACTIVITY_ID,
title: this.CH_SUBJECT,
start: this.start,
end: this.end,
allDay: this.BL_ALL_DAY
});
});
callback(events);
});
}
});
但我有一个问题,当我拖动来自数据库的事件并切换日历视图时,所有事件都会返回到其默认位置。
当我切换日历视图时,我希望更改事件以保护其位置。
I'm using Fullcalendar in my Asp.Net 1.1 application. For taking data from server side, I use Ajaxpro. So codes to gets events to Fullcalendar are written as below:
$calendar.fullCalendar({
editable: true,
selectable: true,
theme: true,
height: 545,
defaultView: 'agendaWeek',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: function(start, end, callback) {
dss.user_activity.getActivities(function(doc) {
var events = [];
var obj = jQuery.parseJSON(doc.value);
$(obj.Head).each(function() {
events.push({
id: this.SQ_USER_ACTIVITY_ID,
title: this.CH_SUBJECT,
start: this.start,
end: this.end,
allDay: this.BL_ALL_DAY
});
});
callback(events);
});
}
});
But I have a problem that, When I drag an events which came from database and switch Calendar's view, all events go back to their default location.
I want changed events to protect their location, when I swtich the Calendar view.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
然后,您需要将事件保存到数据库中。对事件的放置事件使用回调,将其保存到数据库中。当您切换视图时,它会通过调用数据库来刷新事件。
You need to save events to the database, then. Use a callback on the drop event for your event to save it to the database. When you switch views, it refreshes the events by calling the database.