Posted on 2008-11-24 23:09
Robert Su 閱讀(112)
評論(0) 編輯 收藏
<script>
function a()
{
alert('some thing');
}
Ext.onReady(function(){
Ext.get("btnAlert").addListener("click",a);
});
</script>
<input id="btnAlert" type="button" value="alert框" />
addLinster方法的另外一個簡寫形式是on
Ext.get("btnAlert").on("click",a);
ExtJS支持事件隊列,可以往對象的某一個事件中添加多個事件響應函數——
Ext.onReady(function(){
Ext.get("btnAlert").on("click",a);
Ext.get("btnAlert").on("click",a);
})