Jump to content

Recommended Posts

Posted (edited)

How is it possible to create a ClientEvent-> UniEvent on TUniButtons at Runtime?

I tried on the creation of the Form but it doesn't work ...

TMainForm.UniFormShow procedures (Sender: TObject);
begin
   UniButton14.ClientEvents.UniEvents.AddPair ('beforeInit',
                          'function beforeInit (sender, config)'
                         + '{'
                         + 'config.baseCls = "btn"; '
                         + 'config.cls = "btn-secondary"'
                         + '}'
                         + 'end; ');
end;

While if I insert the codes to DesignTime it works perfectly.

Thanks

Edited by marzio
Posted
27 minutes ago, marzio said:

Don't Work!

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniButton1.JSInterface do
  begin
    JSConfig('baseCls', ['btn']);
    JSConfig('cls', ['btn-secondary']);
  end;

end;

 

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