簡體   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