Jump to content

Custom Component


shawdown

Recommended Posts

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;
Link to comment
Share on other sites

  • 1 year later...

Hi,

I want to put a javascript encapsulate on a customDateTimePicker.

function afterrender(sender, eOpts) {
$("#"+sender.inputEl.id).inputmask("99/99/9999",{placeholder:"__/__/____"});

I'm trying to add the method on WebCreate but it give me error 'There is no Default JavaScript Object. [ : TUniSmDateTimePicker]'.

If I put it in LoadCompleted, it doesn't work.

Is there any other method to add the listener that could be encapsulate?

 

Link to comment
Share on other sites

4 minutes ago, Sherzod said:

Also you can use ClientEvents. 

I already use ClientEvents but I would like to encapsulate my method.

Which method ClientEvents is loaded? Is there a way to override it?

Link to comment
Share on other sites

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