andyhill Posted October 15, 2017 Share Posted October 15, 2017 I am trying to set a TUnimEdit Font properties in code, please advise how - thanks in advance. procedure TMyForm.UnimFormCreate(Sender: TObject); var ss: TUniStrings; begin ss.Add('{'); ss.Add(' config.style = "color: blue; font-size: 12px;"'); ss.Add('}'); edtPhone.ClientEvents.UniEvents.Ext.field.Text.beforeinit.AddStrings(ss); end; Link to comment Share on other sites More sharing options...
mhmda Posted October 15, 2017 Share Posted October 15, 2017 You can to refer to Touch docs: http://docs.sencha.com/touch/2.2.1/#!/api/Ext.field.Text To use it: function beforeInit(sender, config) { config.cls='xxxxx'; config.labelCls='yyyyy'; } Link to comment Share on other sites More sharing options...
andyhill Posted October 15, 2017 Author Share Posted October 15, 2017 Yes but how do I do this in code at runtime in Delphi ? Link to comment Share on other sites More sharing options...
Sherzod Posted October 16, 2017 Share Posted October 16, 2017 Hi, Yes but how do I do this in code at runtime in Delphi ? For example like this: 1. MainmForm -> OnCreate: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin UnimEdit1.ClientEvents.UniEvents.Values['beforeInit'] := 'function (sender, config) {config.cls="_customCls"}'; end; 2. UniServerModule -> CustomCSS: ._customCls { font-size: 12px; } ._customCls .x-input-el { color: blue; } Best regards, 1 Link to comment Share on other sites More sharing options...
andyhill Posted October 16, 2017 Author Share Posted October 16, 2017 Thank You Link to comment Share on other sites More sharing options...
Recommended Posts