EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: hbento on July 22, 2015, 06:02:30 AM



Title: Closing Modal Window with Escape Key
Post by: hbento on July 22, 2015, 06:02:30 AM
Hi
How to setup the usual behaviour for the Escape Key when a modal easyui-window is opened?

I know the standard way, but is there any "data-option" that helps us setting the key for easyui-linkbutton? Like escape key or F1?


Title: Re: Closing Modal Window with Escape Key
Post by: yamilbracho on July 22, 2015, 07:31:13 PM
Maybe use bind of a keyboard event (keyup, keypress, etc), for example

$('#target').bind('keyup', function(event) {
 //event.keycode is the ascii code for the pressed key, so 27 is escape key...
      });

HTH,
Yamil


Title: Re: Closing Modal Window with Escape Key
Post by: hbento on July 27, 2015, 08:27:20 AM
Thanks
That I knew.
I believe it should there be some property more "easyui style".
Thanks Anyway