gpt4 book ai didi

extjs - Calendar Pro - 如何配置为使用不在可扩展所有调试中的 src 路径

转载 作者:行者123 更新时间:2023-12-02 10:54:25 24 4
gpt4 key购买 nike

我使用extensible-1.5.1并且我运行应用程序

extensible-1.5.1/examples/calendar/TestApp/test-app.html

我尝试通过在表单中​​添加新的textfield来自定义Event表单窗口。这是默认表单

enter image description here

但我找不到要编辑的文件。

我认为在extensible-1.5.1\src\calendar\form\EventWindow.js中。但是当我删除 src 文件夹时,项目仍然正常工作,没有任何变化?

如何做到这一点,谢谢

编辑
我在 extensible-all-debug.js 文件中发现了这一点。但那个文件确实很复杂

如何配置以使用 extensible-1.5.1\src\ 中的数据,如 extjs 示例中的日历

最佳答案

您是正确的,您需要使用的类是Extensible.calendar.form.EventWindow。但是,您应该扩展该类并创建您自己的版本,而不是编辑该文件。您可以使用该文件作为指南,并重写 getFormItemConfigs 函数以根据需要修改表单:

Ext.define("MyApp.view.EventWindow", {
extend: "Extensible.calendar.form.EventWindow",
modal: true,
enableEditDetails: false,

initComponent: function()
{
this.callParent();
},

getFormItemConfigs: function() {
var items = [/*your form items here */];

return items;
},
//... other stuff here maybe...
});

然后,您可以覆盖Extensible.calendar.view.AbstractCalendar以使用您刚刚创建的类:

Ext.define("MyApp.view.AbstractCalendarOverride", {
override: 'Extensible.calendar.view.AbstractCalendar',

getEventEditor : function()
{
this.editWin = this.ownerCalendarPanel.editWin;

if(!this.editWin)
{
//Change this line:
this.ownerCalendarPanel.editWin = Ext.create('MyApp.view.EventWindow', {
id: 'ext-cal-editwin',
calendarStore: this.calendarStore,
modal: this.editModal,
enableEditDetails: this.enableEditDetails,
listeners: {
'eventadd': {
fn: function(win, rec, animTarget) {
//win.hide(animTarget);
win.currentView.onEventAdd(null, rec);
},
scope: this
},
'eventupdate': {
fn: function(win, rec, animTarget) {
//win.hide(animTarget);
win.currentView.onEventUpdate(null, rec);
},
scope: this
},
'eventdelete': {
fn: function(win, rec, animTarget) {
//win.hide(animTarget);
win.currentView.onEventDelete(null, rec);
},
scope: this
},
'editdetails': {
fn: function(win, rec, animTarget, view) {
// explicitly do not animate the hide when switching to detail
// view as it looks weird visually
win.animateTarget = null;
win.hide();
win.currentView.fireEvent('editdetails', win.currentView, rec);
},
scope: this
},
'eventcancel': {
fn: function(win, rec, animTarget){
this.dismissEventEditor(null, animTarget);
win.currentView.onEventCancel();
},
scope: this
}
}
});
}

// allows the window to reference the current scope in its callbacks
this.editWin.currentView = this;
return this.editWin;
}
});

这可能无法满足您的需求,但希望它能让您走上正轨。

关于extjs - Calendar Pro - 如何配置为使用不在可扩展所有调试中的 src 路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19408593/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com