If you have an app with just one view and there is even a small possibility that the user will open the app in a browser that they have been using to cruise around the web and the user will likely use the backspace key in your app then you should think about turning off the backspace == url -1 feature in most browsers.
If you actually want to use the backspace button for its intended purpose and you would like to map ext events to the browser history then a good choice might be using Ext.History, which you can learn about in depth by reading Ed Spencer’ blog post its use. (http://edspencer.net/2009/01/why-you-should-be-using-history-in-your.html )
Turning off the backspace key is pretty straight forward. You would just use Ext’s EventManager and create a listener to check for any keypress events that take place on the page. If the user is not in an input field then you would ignore the default action of the backspace button. Placing the code below right under your Ext.onReady … method will do the trick.
Ext.EventManager.addListener(Ext.getBody(), 'keydown', function(e){
if(e.getTarget().type != 'text' && e.getKey() == '8' ){
e.preventDefault();
}
});
I appreciate, cause I found exactly what I was having a look
for. You have ended my 4 day long hunt! God Bless you man.
Have a great day. Bye