Jump to content

Execute AjaxEvent with TuniEdit on Enter key press


GerhardV

Recommended Posts

I have a TuniEdit on a form for search functionality. I do not want to trap the OnKeyPress event on the server side because of all the traffic hence I have added the event below:

 

ClientEvents | ExtEvents | Ext.form.field.text

function keypress(sender, e, eOpts)
{
   if (e.getKey() == 13 ) {
      sender.showMask('Searching...');
      ajaxRequest(sender, 'doSearch', [editboxText?]); 
   }
}

I am not sure how to obtain the text from the TuniEdit to send through as a parameter?

 

Does anybody know?

Link to comment
Share on other sites

Hi,

   ...
   if (e.getKey() == 13 ) {
      sender.showMask('Searching...');
      ajaxRequest(sender, 'doSearch', ["editboxText="+sender.getValue()]);
   }
   ...
procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = 'doSearch' then
  begin
    ShowMessage(Params.Values['editboxText']);
  end;

end;

Best regards.

  • Upvote 2
Link to comment
Share on other sites

  • 3 years later...

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