我们正在尝试在ViewController中实现Ext.mixin.Observable
,下面的代码段
mixins: ['Ext.mixin.Observable'],
constructor: function(config){
this.mixins.observable.constructor.call(this, config);
},
但是这会在Viewcontroller中引发this.mixins.observable.constructor.call(this, config);
的错误
BaseController.js?_dc=1587282588103:440 Uncaught TypeError: Cannot read property 'listen' of undefined
at constructor.listen (BaseController.js?_dc=1587282588103:440)
at constructor.callParent (Base.js?_dc=1587282588090:1479)
at constructor.listen (ViewController.js?_dc=1587282588091:206)
at constructor.updateListen (BaseController.js?_dc=1587282588103:257)
at constructor.setter [as setListen] (Config.js?_dc=1587282588102:329)
at Ext.Configurator.configure (Configurator.js?_dc=1587282588102:674)
at constructor.initConfig (Base.js?_dc=1587282588090:1650)
at constructor (Observable.js?_dc=1587282588091:437)
at constructor (MainController.js?_dc=1587282588090:6)
这里可能出了什么问题,我遵循了sencha文档中Ext.mixin.Observable
的文档
看起来像您在调用可观察的构造函数后错过了构造函数中的this.callParent(arguments)