Jump to content

Recommended Posts

Posted

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???

post-125-0-99338700-1311019923_thumb.png

Posted

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.

Posted

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????

  • Administrators
Posted

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');

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...