FullCalendar的事件功能

发布于 2024-09-12 13:57:40 字数 1242 浏览 3 评论 0原文

我在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青柠芒果 2024-09-19 13:57:40

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文