Extjs自定义事件
//为per对象添加拦截器
<span style="color:red">Ext.util.Observable.capture(per,captureFunction);</span>
//拦截函数
function captureFunction(eventName){
if(eventName=='onSay'){ //事件名称是onSay则返回 false终止事件的执行
alert("拦截事件:"+eventName+"。");
return false;
}
return true;
}
});
capture拦截器 Extjs通过capture方法为事件的执行提供了拦截器功能,给了我们控制是否执行特定事件的能力。