xtype: 'component',
cls: 'headerComponent',
id: 'RequirementHeader' + i,
itemId: 'requirementHeaderViewID-' + i,
html: arrReqTplHeader,
constructor: function (config) {
var me = this,
currentConfig = me.config;
me.fireEvent('initialize', me);
},
initialize: function (obj) {
var me = this;
me.element.down('img').on('tap', me.imageTap, this, me);
}, imageTap: function (obj) {
alert("it doest reach here");
}
我在sencha touch中有这个组件,当我在测试环境中使用它时工作正常,但是一旦我构建项目它就不会在构建版本中调用initialize函数, 有人可以帮我这个。我已经尝试谷歌搜索问题,但没有用。
答案 0 :(得分:1)
当您覆盖initialize
:
initialize: function (obj) {
var me = this;
me.callParent(arguments);
me.element.down('img').on('tap', me.imageTap, this, me);
}
我认为在这种情况下你不需要构造函数,因为始终会调用initialize。