Javascript 如何在alloyui的调度程序中使用getUpdatedSchedulerEvent
我是alloyui的新成员。我目前正在使用alloyui定义一个简单的调度程序视图。当我阅读alloyui时,我对如何使用函数getUpdatedSchedulerEvent感到非常困惑。我在谷歌上搜索过,但是很难找到例子,而且文档也不能很直观地解释它 有人能给我提供一些详细的解释或简单的例子吗 多谢各位 定义我使用的计划程序的代码如下:Javascript 如何在alloyui的调度程序中使用getUpdatedSchedulerEvent,javascript,frontend,alloy-ui,Javascript,Frontend,Alloy Ui,我是alloyui的新成员。我目前正在使用alloyui定义一个简单的调度程序视图。当我阅读alloyui时,我对如何使用函数getUpdatedSchedulerEvent感到非常困惑。我在谷歌上搜索过,但是很难找到例子,而且文档也不能很直观地解释它 有人能给我提供一些详细的解释或简单的例子吗 多谢各位 定义我使用的计划程序的代码如下: var schedulerViews = [ new Y.SchedulerWeekView(), new Y.SchedulerDayVie
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
});
我幸运地做到了以下几点:
数据:{“content”:this.getContentNode().val(),“startDate”:新日期(this.get('startDate')).getTime()/1000-18000,“endDate”:新日期(this.get('endDate')).getTime()/1000-18000},
我很幸运地做到了以下几点:
data:{“content”:this.getContentNode().val(),“startDate”:新日期(this.get('startDate')).getTime()/1000-18000,“endDate”:新日期(this.get('endDate')).getTime()/1000-18000},