Jump to content

Setting ClientEvents.UniEvents.Ext.field.Text.beforeinit in code - How ?


andyhill

Recommended Posts

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

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,

  • Upvote 1
Link to comment
Share on other sites

×
×
  • Create New...