레이블이 Event인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Event인 게시물을 표시합니다. 모든 게시물 표시

2009년 3월 6일 금요일

Ext.form.TextField 이벤트(event)처리

txt_qty = new Ext.form.TextField({
                id    : Ext.id(),
                width : 30,
                height: 15
                ,enableKeyEvents: true
                ,onBlue: "javascript:alert('x')"
    });
    txt_qty.on ({
        keyup : {
            fn: function(o,e){
                alert( 'up'+ o.getValue() )
            }
        }
    })


keyup, keydown event는 "enableEeyEvents"가 반듯이 true로 설정 되어 있어야 한다.

2008년 4월 29일 화요일

event tab



 var tabs2 = new Ext.TabPanel({
        renderTo: document.body,
        activeTab: 0,
        width:600,
        height:250,
        plain:true,
        defaults:{autoScroll: true},
        items:[{
                title: 'Normal Tab',
                html: "My content was added during construction."
            },{
                title: 'Ajax Tab 1',
                autoLoad:'ajax1.htm'
            },{
                title: 'Ajax Tab 2',
                autoLoad: {url: 'ajax2.htm', params: 'foo=bar&wtf=1'}
            },{
                title: 'Event Tab',
                listeners: {activate: handleActivate},
                html: "I am tab 4's content. I also have an event listener attached."
            },{
                title: 'Disabled Tab',
                disabled:true,
                html: "Can't see me cause I'm disabled"
            }
        ]
    });
event catch의 다른 방법이 보임

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