Jump to content


Photo

Custom Component


  • Please log in to reply
7 replies to this topic

#1 shawdown

shawdown

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 91 posts

Posted 10 August 2018 - 01:36 PM

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?
 
 

 


  • 0

#2 shawdown

shawdown

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 91 posts

Posted 13 August 2018 - 12:02 PM

Any suggestion.

  • 0

#3 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5317 posts

Posted 14 August 2018 - 09:28 AM

Hi,

 

Sorry for delay,

 

Also you can use IUniJSInteface, for example:

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

  • 0

#4 GerhardV

GerhardV

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 212 posts
  • LocationSouth Africa

Posted 14 August 2018 - 01:21 PM

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;

  • 0

uniGUI - LOVE IT!


#5 shawdown

shawdown

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 91 posts

Posted 14 August 2018 - 04:25 PM

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;

  • 0

#6 shawdown

shawdown

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 91 posts

Posted 14 August 2018 - 08:51 PM

Lastly, what would be the way to add this code to a custom component?

 

 

Attached File  Screenshot_2.png   14.68KB   5 downloads


  • 0

#7 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5317 posts

Posted 15 August 2018 - 04:24 AM

JSConfig('remoteSort', [False], DataStore);

  • 0

#8 shawdown

shawdown

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 91 posts

Posted 15 August 2018 - 01:03 PM

JSConfig('remoteSort', [False], DataStore);

 

Perfect.
Thank you one more time.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users