ExtJS4到6迁移类
我们有用ExtJS4编写的js文件。我必须将theese迁移到ExtJS6。几乎所有的事情都很好,但是当我们ExtJS4到6迁移类,extjs,extjs4,extjs6,extjs6-classic,Extjs,Extjs4,Extjs6,Extjs6 Classic,我们有用ExtJS4编写的js文件。我必须将theese迁移到ExtJS6。几乎所有的事情都很好,但是当我们创建自己的类(扩展的extjs类)时,我们遇到了一个问题。(不幸的是,这里没有mvc,只有类和create)。在ext all debug中: create: function(config, defaultType) { if (typeof config === 'string') { return Ext.widget(config); } i
创建自己的类(扩展的extjs类)时,我们遇到了一个问题。(不幸的是,这里没有mvc,只有类和create
)。在ext all debug中:
create: function(config, defaultType) {
if (typeof config === 'string') {
return Ext.widget(config);
}
if (config.isComponent) {
return config;
}
if ('xclass' in config) { // **config is true**
return Ext.create(config.xclass, config);
}
return Ext.widget(config.xtype || defaultType, config);
},
除了一个对象之外,config
是true
,我们在控制台中得到以下错误消息:“无法使用'in'运算符在true中搜索'xclass'
我们的课程或创作有什么问题
这是一门课:
Ext.define("My.component.TrunkListGrid", {
extend: "My.component.Grid",
// config
viewConfig: {
enableTextSelection: true
},
initComponent: function () {
// ...
Ext.apply(this, {
// ...
});
this.callParent();
this.addListener('render', function () {
// ...
}, this);
}
});
这是一个创建:
var g = Ext.create('My.component.TrunkListGrid', {
// config
});
我想,我必须用另一种方式来称呼某物…哇,我找到了!我们使用了配置中的按钮:true
,请显示你失败的班级的代码。几乎每个浏览器都会提供完整的堆栈跟踪,请将其附加到您的问题中。我认为每个类都会失败:(那么,请显示一些Ext.create示例。请显示您的dockedItems
配置,它似乎是true
或至少包含一个值true
tbar:this.showTbar?{items:tbItems}:未定义,