在我们的4.2.2应用程序中,我们在容器上注册了一个click事件,如下所示,但它在ExtJS 5中不起作用。任何想法?
'afterrender': function(comp) {
comp.getEl().on({
'click' : {
fn: function (el) {
this.fireEvent('click', comp);
},
scope: comp
},
'mouseover' : {
fn: function (el) {
el.target.style.cursor = "pointer";
},
scope: comp
}
}, comp);
}
答案 0 :(得分:1)
删除范围" comp"从"结束"调用
在:
'afterrender': function(comp) {
comp.getEl().on({
'click' : {
fn: function (el) {
this.fireEvent('click', comp);
},
scope: comp
},
'mouseover' : {
fn: function (el) {
el.target.style.cursor = "pointer";
},
scope: comp
}
}, comp);
}
在:
'afterrender': function(comp) {
comp.getEl().on({
'click' : {
fn: function (el) {
this.fireEvent('click', comp);
},
scope: comp
},
'mouseover' : {
fn: function (el) {
el.target.style.cursor = "pointer";
},
scope: comp
}
});
}