var tabs2 = new Ext.TabPanel({event catch의 다른 방법이 보임
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"
}
]
});
Extjs는 eventmanager라는 class가 있음
http://extjs.com/deploy/ext/docs/output/Ext.EventManager.html#addListener
예를들어 extjs.store가 load가 발생할 경우 load라는 이벤트가 발생한다.
api 메뉴얼에서 참조 하면 됨.
발생된 event를 catch해서 작업을 수행하고자 할 경우
샘플
///////////////////////////////////////
// 실 소스에서 event 추가
// store는 Extjs.store를 사용
store.on ({
'load':{
fn: function(){
alert('aborted')
}
}
});
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')
}
}
});






104617
62
181









댓글을 달아 주세요