Jump to content
uniGUI Discussion Forums
shawdown

Custom Component

Recommended Posts

Hello, I am creating a custom component inherited from uniEdit.
In this component I would like to add a function in the ExtEvents KeyDown event.
 
What would be the correct way to do it?
 
 

 

Share this post


Link to post
Share on other sites

Hi,

 

Sorry for delay,

 

Also you can use IUniJSInteface, for example:

JSAddListener('keydown', 'function(sender, e, eOpts){...}'); 

Share this post


Link to post
Share on other sites

Delphi Developer, correct me if I am wrong but I assume he would need to add that call in the "WebCreate" method  which needs to be overridden in a custom component?

TCustomControl = class(TUniEdit)
protected
  procedure WebCreate; override;
end;

procedure TCustomControl.WebCreate;
begin
  inherited;
  JSAddListener('keydown', 'function(sender, e, eOpts){...}');
end;

Share this post


Link to post
Share on other sites
Hello friends I added in the create event and it worked perfectly.

Having trouble using create?

 



constructor TCustomControl.Create(AOwner: TComponent);
Begin
  inherited;
  JSAddListener('keydown', 'function(sender, e, eOpts){...}');
End;

Share this post


Link to post
Share on other sites
JSConfig('remoteSort', [False], DataStore);

 

Perfect.
Thank you one more time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×