블로그 이미지
Xeon의 세상 Xeoness

카테고리

Xeon World (23)
Diary (1)
Tuning (0)
Project (0)
Scrap (0)
Media (0)
L ♡ L (0)
일상생활 (4)
Web Programming (14)
IT 강국? 노가다 강국 (4)
Linux (0)
아리아리 동동~ (0)
Total
Today
Yesterday

var el = Ext.get('myDiv');
el.on('click', doSomething);
Ext.get을 이용한 기본적인 방식.

Here, we use the native method, Ext.get, which allows Ext to wrap its element management class, Ext.Element, around a referenced element. Embedded with each instance of Ext.Element is the usage of the Ext event management engine, Ext.util.Observable. It is important to remember that all event management with Ext stems from Ext.util.Observable, which serves as a base for all DOM elements and components that need to manage events.
Next, we attach a listener by calling the el.on and pass the native event to be handled and a method to perform an action on the event. Ext takes event listener registration a step further by allowing you to pass a reference to the scope from which the event handler is to be called and any parameters:

var el = Ext.get('myDiv');
el.on('click', doSomething, scopeRef, [opt1, opt2]);
on 함수에 파라미터 추가

It’s important to note that the default scope is always the object from which the handler is being defined. If scope were not explicitly passed, the method doSomething would be called within the scope of the object el, which is an instantiation of Ext.Element.
Posted by Xeoness
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함