donlego Posted February 24, 2018 Share Posted February 24, 2018 (edited) hi i have procedure like this call a form and create runtime unibutton on my form myprocedure(); var funitoolbar: TUniPanel; funitoolbutton_close, funitoolbutton_xls, funitoolbutton_filter: TUniButton; begin funitoolbutton_close := TUniButton.Create(funitoolbar); funitoolbutton_close.ClientEvents.UniEvents.Values['beforeInit'] := 'function (sender, config) {config.cls="_customCls"}'; funitoolbutton_close.Parent := funitoolbar; funitoolbutton_close.Caption := 'Tutup'; funitoolbutton_close.Width := 80; funitoolbutton_close.Align := alLeft; funitoolbutton_close.BorderStyle := ubsNone; funitoolbutton_close.Cursor := crHandPoint; end; but when i set client event there is nothing chenge with my runtime buton style , how can i change the runtime create unibutton beforeinit on runtime ? unigui version : profesional edition v.1.0.0.1424 (trial) Edited February 24, 2018 by donlego Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 24, 2018 Share Posted February 24, 2018 Hello, Give the name to the created component Quote Link to comment Share on other sites More sharing options...
donlego Posted February 24, 2018 Author Share Posted February 24, 2018 [solved] replace funitoolbutton_close.ClientEvents.UniEvents.Values['beforeInit'] := 'function (sender, config) {config.cls="_customCls"}'; with this UniSession.AddJS(funitoolbutton_filter.JSName + '.addCls(''_customCls'');'); 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.