2008년 4월 7일 월요일

event 처리

Extjs는 eventmanager라는 class가 있음
http://extjs.com/deploy/ext/docs/output/Ext.EventManager.html#addListener

예를들어 extjs.store가 load가 발생할 경우 load라는 이벤트가 발생한다.
api 메뉴얼에서 참조 하면 됨.

발생된 event를 catch해서 작업을 수행하고자 할 경우

샘플
el.on({
    'click' : {
        fn: this.onClick
        scope: this,
        delay: 100
    },
    'mouseover' : {
        fn: this.onMouseOver
        scope: this
    },
    'mouseout' : {
        fn: this.onMouseOut
        scope: this
    }
});


    ///////////////////////////////////////
    // 실 소스에서 event 추가
    // store는 Extjs.store를 사용
    store.on ({  
        'load':{
            fn: function(){
                alert('aborted')
            }
        }
    }); 

댓글 없음:

댓글 쓰기