【发布时间】:2015-01-02 15:05:22
【问题描述】:
我正在尝试通过一个通用的类名为多个项目委派一个事件,但是它似乎不起作用。委托多个 ID 应该可以,但我收到一条错误消息:“无效的 ComponentQuery 选择器”。
这是我目前拥有的:
Ext.define("App.view.Main", {
extend : "Ext.Container",
config : {
listeners : {
disclose : {
fn : "onElementDisclose",
delegate : [ "#onelist", "#anotherlist" ] // this don't work
// delegate : ".lists" <- this also don't work
// delegate : "#onelist, #anotherlist" <- this don't work either
// delegate : "#onelist" <- but this work!
}
},
},
initialize : function() {
this.callParent(arguments);
this.add([ {
xtype : "slideshow",
}, {
xtype : "onelist",
}, {
xtype : "anotherlist",
} ]);
},
onElementDisclose : function () {
console.log("click");
},
});
两个列表都有“onItemDisclosure : true”和“cls: lists”。
我怎样才能做到这一点?
【问题讨论】:
标签: extjs sencha-touch sencha-touch-2 dom-events