- Add new BrowserParam to event:
Example:
delphi code12345678procedure
TIWForm1
.
IWAppFormCreate(Sender: TObject);
begin
with
IWCGJQEdit1
.
JQEvents
.
OnKeyPress
.
BrowserParams
.
Add
do
begin
ServerName:=
'keypressed'
;
BrowserScript:=
'e.keyCode || e.which'
;
end
;
end
;
Note: You can add the new BrowserParam in design-time or run-time. - On KeyPress event, get the passed parameter:
Example:
delphi code1234procedure
TIWForm1
.
IWCGJQEdit1JQEventsKeyPress(Sender: TObject; AParams: TStringList);
begin
WebApplication
.
ShowMessage(AParams
.
Values[
'keypressed'
]);
end
;
If you need to run the event in a certain key, you should use the Condition property.
This will prevent that on each key pressed, will call the event on server.
Example for "Enter":
delphi code
1 2 3 4 5 6 7 | procedure TIWForm1 . IWAppFormCreate(Sender: TObject); begin with IWCGJQEdit1 . JQEvents . OnKeyPress do begin Condition:= '((e.keyCode==13) || (e.which==13))' end ; end ; |
Best Regards.