extjs4 - extjs closing a Ext.window.Window on ESC -


i'm working on extjs4. have grid panel. on selecting row of grid panel, create simple window. close when user hits esc. if user clicks in window , clicks esc, window closed. if user didn't touched window yet, esc not close window. idea how that?

var win = ext.create('ext.window.window', {                     title: 'details',                     width: 400,                         layout: 'fit',                         iconcls: 'details-icon',                         items: simple                     }).show(); 

maybe it's no foucus @ win.

or try use this:

listen window show event, , add keymap document:

 var map = new ext.util.keymap(ext.getbody(), [{     key: ext.eventobject.esc,     defaulteventaction: 'preventdefault',     scope: this,     fn: function(){win.close()}  }]); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -