View Full Version : How to detect escape key press when a progress message is being shown with loadmask

24 Jun 2015, 7:08 AM
I am basically trying to stop my users from cancelling the extjs progressbar while processing a server side request.

I know how to detect keypress for key number 27 (escape key) on document and window.
but apparently when ext progress bar is up ( with a load mask occupying the whole screen),
Those listeners seem not to work.

I tried getting messagebox.getEl() and applying listeners on it, but that also did not work.
Please help me, I know its a small solution, but I am just not able to figure out the right place to put keypress listener on.


24 Jun 2015, 9:15 AM
Check out the Ext.MessageBox.onEsc (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.window.Window-cfg-onEsc) option. You can supply this with an empty function to prevent the close action.