We have js files writen in Extjs 4. I have to migrate theese to Extjs 6. Almost everything is fine, but when we create
own classes (extended extjs classes), we have a problem. (Unfortunately there's no mvc, just classes and create
). In the 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);
},
The config
is true
except an object, and we got the following error message in the console: "Cannot use 'in' operator to search for 'xclass' in true"
What is the problem with our classes or creating?
This is a class:
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);
}
});
This is a create:
var g = Ext.create('My.component.TrunkListGrid', {
// config
});
I think, I have to call something another way...