Jump to content

Problem to set UniEvents run-time


Recommended Posts

Problem to set UniEvents runtime, example:

 

procedure TFmeCadastroMestre.UniFormCreate(Sender: TObject);

...

  uniGUIClientEvents.TUniClientEvents(EdtCodigo.ClientEvents).UniEvents.Add('afterrender=function afterrender(sender, eOpts)');
  uniGUIClientEvents.TUniClientEvents(EdtCodigo.ClientEvents).UniEvents.Add('{');
  uniGUIClientEvents.TUniClientEvents(EdtCodigo.ClientEvents).UniEvents.Add('    sender.emptyText = "123";');
  uniGUIClientEvents.TUniClientEvents(EdtCodigo.ClientEvents).UniEvents.Add('}');
 
  or 
 
  EdtCodigo.ClientEvents.UniEvents.Text := 'afterrender=function afterrender(sender, eOpts)'#13#10'{'#13#10'    sender.e' +
      'mptyText = "123";'#13#10'}';

...

end;

post-1677-0-24619500-1400852704_thumb.png

Link to post
Share on other sites
  • Administrators


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniButton1.ClientEvents.ExtEvents.Values['click']:='function(sender){alert("Click")}';
  UniEdit1.ClientEvents.ExtEvents.Values['change']:='function(sender, newValue){MainForm.UniEdit2.setValue(newValue)}'; 
Self.ClientEvents.ExtEvents.Values['form.click']:='function(sender){MainForm.UniEdit2.setValue("form.click")}'; 
Self.ClientEvents.ExtEvents.Values['window.move']:='function(sender){MainForm.UniEdit2.setValue("window.move")}';
end;

 

Link to post
Share on other sites
procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniButton1.ClientEvents.ExtEvents.Values['click']:='function(sender){alert("Click")}';
  UniEdit1.ClientEvents.ExtEvents.Values['change']:='function(sender, newValue){MainForm.UniEdit2.setValue(newValue)}';  
  Self.ClientEvents.ExtEvents.Values['form.click']:='function(sender){MainForm.UniEdit2.setValue("form.click")}';  
  Self.ClientEvents.ExtEvents.Values['window.move']:='function(sender){MainForm.UniEdit2.setValue("window.move")}';
end;

 

great trick brow.... gracias!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...