繁体   English   中英

如何在alloyui的调度器中使用getUpdatedSchedulerEvent

[英]How to use getUpdatedSchedulerEvent in the scheduler of alloyui

我是alloyui的新手。 我目前正在使用alloyui 来定义一个简单的调度程序视图。 当我阅读alloyui 的api doc 时,我对如何使用函数getUpdatedSchedulerEvent 感到非常困惑。 我在谷歌上搜索过,但例子很难找到,而且文档也没有很直接地解释它。

有人可以向我提供一些详细的解释或简单的例子吗?

非常感谢。

我使用的定义调度程序的代码如下:

var schedulerViews = [
    new Y.SchedulerWeekView(),
    new Y.SchedulerDayView(),
    new Y.SchedulerMonthView()
];

var eventRecord = new Y.SchedulerEventRecorder({
    on: {
        save: function (event) {
            var start_time = this.getClearStartDate();
            var end_time = this.getClearEndDate();
            var facility_name = "{{ item.facility.facility_name }}";
            $.ajax({
                url: "/TT/#tab-{{item.facility.facility_name}}",
                type: 'post',
                data: {json_data: JSON.stringify({start_time: start_time, end_time: end_time, facility_name: facility_name})},
                success: function (response) {
                },
                complete: function () {

                },
                error: function (xhr, textStatus, thrownError) {
                    alert("error doing something");
                }
            });

{#                                    alert('Save Event:' + this.isNew() + ' --- ' + this.getContentNode().val());#}
            alert('Save Event:' + this.isNew() + ' --- ' + this.getClearStartDate());

        },
        edit: function (event) {
            alert('Edit Event:' + this.isNew() + ' --- ' + this.getContentNode().val());
        },
        delete: function (event) {
            alert('Delete Event:' + this.isNew() + ' --- ' + this.getContentNode().val());
        }
    }
});

new Y.Scheduler({
    boundingBox: '#myScheduler-{{item.facility.facility_name}}',
    items: events,
    render: true,
    views: schedulerViews,
    activeView: schedulerViews[0],
    eventRecorder: eventRecord
});

我很幸运地做了以下事情:

data: { "content": this.getContentNode().val(), "startDate": new Date( this.get('startDate') ).getTime() / 1000 - 18000, "endDate": new Date( this.get('endDate') ).getTime() / 1000 -18000 },

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM