ExtJS 6.2 - issue with initConfig



ExtJS 版本 6.2

我不允许在构造器中从我的扩展文本字段调用 initConfig((。它抛出的错误是, initConfig should not be called by subclasses, it will be called by Ext.Component(…) .

出于某种原因,我不能在那里使用 callParent((。它在 ExtJS 5.0 中可用。还有其他选择吗?

使用 Ext.apply(this, cfg( 而不是 initConfig((。它将解决您的问题。

示例旧代码:

 constructor: function(cfg){
         this.initConfig(cfg);
    },

示例正确代码:

constructor: function(cfg){
    //this.initConfig(cfg);
    Ext.apply(this, cfg);
},

最新更新