如何在日历 Week
和 day
View 上添加 eventClick
监听器。我在月
View 上添加了监听器,它工作正常,但我在周和日 View 上没有事件。有没有一种方法可以将事件添加到这些 View 中。或者任何解决办法。
我也不想为此包含整个扩展
。
xtype: 'panel',
title: 'Calendar',
layout: 'fit',
width: 1200,
height: 600,
items: [{
xtype: 'calendar',
views: {
day: {
addForm: null,
editForm: null,
listeners: {
eventtap: 'onEventClick' //this doesn't work
}
},
week: {
addForm: null,
editForm: null,
listeners: {
eventtap: 'onEventClick' //this doesn't work
}
},
month: {
addForm: null,
editForm: null,
listeners: {
eventtap: 'onEventClick' // this works
}
}
},
bind: {
store: '{calendars}'
}
}]
默认的“添加”和“编辑”表单正在运行,但我想在事件单击时打开自己的窗口以仅显示有关事件的详细信息。不是默认的可编辑或可添加窗口。
是否有解决方法可以像月 View
一样为周
和日
View 添加事件点击
?
最佳答案
ExtJs Calendar 包的源代码中存在错误/问题。 前往
ext/packages/calendar/src/calendar/view/days.js
在 1436
行使用以下代码更改函数 onEventTap
:
onEventTap: function(e) {
var event = this.getEvent(e);
this.fireEvent('eventtap', this, {
event: event
});
this.showEditForm(event);
},
关于javascript - ExtJs 6 日历周和日事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51322050/