日期:2014-05-16  浏览次数:20384 次

extjs过滤浏览器backspace字段防返回上一页

//过滤浏览器backspace字段
??? ???? ??? Ext.getDoc().on('keydown',function(e){
??? ???? ??? ??? if(e.getKey() == 8 && e.getTarget().type =='text' && !e.getTarget().readOnly){
??? ???? ??? ??? ???
??? ???? ??? ??? }else if(e.getKey() == 8 && e.getTarget().type =='textarea' && !e.getTarget().readOnly){
??? ???? ??? ???
??? ???? ??? ??? }else if(e.getKey() == 8){
??? ???? ??? ??? ??? e.preventDefault();
??? ???? ??? ??? }
?? ??? ???? ??? ???
});