1.ExtJS4 使用的方法介绍:
addBehaviors( Object obj )
Applies event listeners to elements by selectors when the document is ready. The event name is specified with an @
suffix.
Ext.addBehaviors({
// add a listener for click on all anchors in element with id foo
'#foo a@click' : function(e, t){
// do something
},
// add the same listener to multiple selectors (separated by comma BEFORE the @)
'#foo a, #bar span.some-class@mouseover' : function(){
// do something
}
});
以上是API示例。
2.Ext.EventManager类
给元素绑定事件,还有多种实现,
Ext.fly().on()