dionel1969 Posted July 18, 2011 Share Posted July 18, 2011 Hello !!! I have a UniDateTimePicker on a form, and because it does not have the event OnKeyDown I trying to do via JS events. I did the following to simulate "click on the button called btnRefresh": function OnKeydown(sender, e) { if (e.keyCode == 13) { btnRefresh.click(); } } What I'm doing wrong??? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 18, 2011 Administrators Share Posted July 18, 2011 You can't call click method of a button. function OnKeydown(sender, e) { if (e.getCharCode()==13) { ajaxRequest(sender, 'MyClick'); } } Monitor ajax event on server side. Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted July 20, 2011 Author Share Posted July 20, 2011 You can't call click method of a button. function OnKeydown(sender, e) { if (e.getCharCode()==13) { ajaxRequest(sender, 'MyClick'); } } Monitor ajax event on server side. Ok. Very good. Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted July 20, 2011 Author Share Posted July 20, 2011 BTW, could be posible to implement in this case the Event "OnKeyDown" ??? Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted July 20, 2011 Author Share Posted July 20, 2011 You can't call click method of a button. function OnKeydown(sender, e) { if (e.getCharCode()==13) { ajaxRequest(sender, 'MyClick'); } } Monitor ajax event on server side. One question: Sender is DateTimePicker or Form??? Because if it is DateTimePicker I have not any event associated with it. The event is associated with button named btnRefresh. So the request must looks like: ajaxRequest(btnRefresh, 'btnRefreshClick'); Or I'm wrong???? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 20, 2011 Administrators Share Posted July 20, 2011 You should handle this event in TUniDateTimePicker.OnAjaxEvent handler. I'm not sure if there is a way to call another button's click. Below code may work but I didn't test it: ajaxRequest(MainForm.btnRefresh, 'click'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.