1

我在我的 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);
            });
            }
});

但是我有一个问题,当我拖动来自数据库的事件并切换日历的视图时,所有事件都会返回到它们的默认位置。

当我切换日历视图时,我希望更改事件以保护它们的位置。

4

1 回答 1

1

然后,您需要将事件保存到数据库中。对您的事件的 drop 事件使用回调以将其保存到数据库中。当您切换视图时,它会通过调用数据库来刷新事件。

于 2010-08-02T13:43:32.197 回答