2013년 10월 14일 월요일

Handling events on elements and components

<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
});

댓글 없음:

댓글 쓰기