<div id="my-div">Ext JS 4 Cookbook</div>
var el = Ext.get('my-div');
el.on('click', function(e, target, options){
alert('The Element was clicked!');
alert(this.id);
}, this);
Defining multiple event handlers at once
el.on({
click: function(e, target, options){
alert('The Element was clicked!);
alert(this.id);
},
contextmenu: function(e, target, options){
alert('The Element was right-clicked!');
alert(this.id);
},
scope: this
});
댓글 없음:
댓글 쓰기