zanona Posted August 30, 2017 Posted August 30, 2017 I need to load the beforeinit event in runtime but it does not work! Follow the code below! Procedure TMainmForm.setColorBack (vpComp: TUNIMDBNUMBEREDIT); Var VrsStr: string; Begin VrsStr: = 'beforeInit = function beforeInit (sender, config)'; VrsStr: = vrsStr + '{'; VrsStr: = vrsStr + 'config.maxLength = 10;'; VrsStr: = vrsStr + 'config.clearIcon = false;'; VrsStr: = vrsStr + 'config.inputCls =' 'DataeditMobile yellowBG' ''; VrsStr: = vrsStr + '}'; VpComp.ClientEvents.ExtEvents.Clear; VpComp.ClientEvents.ExtEvents.Add (vrsStr); End; I call the event in the wind form create SetColorBack (SP_Esf_L_OD); Thanks Zanona
Sherzod Posted August 31, 2017 Posted August 31, 2017 Hi, You can not change beforeInit dynamically, only before the initialization of the control, for example: Only in these places: In Designtime (ClientEvents->UniEvents), OnFormCreate, When creating a control dynamically Best regards,
sertatar76 Posted August 15, 2018 Posted August 15, 2018 Hi I wanted to clarify to the "When creating a control dynamically" I need to recreate chart. ... FreeAndNil(UniChart1); UniChart1 := TUniChart.Create(Self); UniChart1.ClientEvents.UniEvents.Add( 'chart.beforeInit=function chart.beforeInit(sender, config)' + '{config.colors = ["#556677", "#112233", "#995577]}'); ... It not work.
sertatar76 Posted August 16, 2018 Posted August 16, 2018 Probably not, I did not quite understand what was meant
sertatar76 Posted August 16, 2018 Posted August 16, 2018 Thanks, what you need. Added name and it works
Recommended Posts