Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by richard white on Mar 02, 2009 13:46
open dhtmlx forum
onenter event

hi

we use various layouts and have created a custom alert box using a dhtmlx window, which also contains a toolbar that contains button that closes the alert box, and a grid that displays various information in it

we would like to add the functionality where the user can hit enter on the keyboard and it is attached to the close button on the toolbar. so when they hit enter on the keyboard it closes the alert box window

can we do this with any functionality in your components?

thanks
Answer posted by Alex (support) on Mar 03, 2009 08:10

Hello, 

You can try to use the following approach to close window on any action:

w.close();

Here w is window object.  

Answer posted on Mar 07, 2009 12:21
thanks for your reply...  how do we attach the window.close() function to occur when a window is open and they click enter.

where do i put the code that listens for the enter to be pressed when a window is open?

thanks
Answer posted on Mar 10, 2009 08:45
do you have any ideas on this please?
Answer posted by Alex (support) on Mar 10, 2009 09:44

Hello, 

The dhtmlxWindows component doesn't provide onkeypress event handler. 

So, you should use own approach to attach "on enter press" event handler to the necessary object.