Ext Implementation Method:
//Method OnevarKey =NewExt.keymap (document,{key:8, fn:function(obj,e) {varType =E.target.type; varReadOnly =e.target.readonly; if(Type! = ' text ' && type! = ' textarea ' && type! = ' Password '){ //E.preventdefault ();e.stopevent (); } Else if(readonly) {//E.preventdefault ();e.stopevent (); }}, Scope: This });//Method TwoExt.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 (); } });
How JavaScript is implemented:
function Document.onkeydown () { if// mask backspace Delete key { if ( Window.event.srcElement.tagName.toUpperCase ()! = "INPUT" && window.event.srcElement.tagName.toUpperCase ()! = "TEXTAREA" && window.event.srcElement.tagName.toUpperCase ()! = "TEXT") { Event.keycode =0; Event.returnvalue=false ; }}}
Disable browser backspace key (BACKSPACE) when jumping page (extjs,javascript)