N.Marzio Posted April 26, 2020 Share Posted April 26, 2020 (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 April 26, 2020 by marzio Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 26, 2020 Share Posted April 26, 2020 Use form create event. Quote Link to comment Share on other sites More sharing options...
N.Marzio Posted April 26, 2020 Author Share Posted April 26, 2020 Don't Work! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 26, 2020 Share Posted April 26, 2020 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; Quote Link to comment Share on other sites More sharing options...
N.Marzio Posted April 26, 2020 Author Share Posted April 26, 2020 Work!! Tks!! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.