David Oliveira Posted May 23, 2014 Posted May 23, 2014 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; Quote
Administrators Farshad Mohajeri Posted May 23, 2014 Administrators Posted May 23, 2014 EdtCodigo.ClientEvents.ExtEvents.add('afterrender=function afterrender(sender, eOpts) { }'); Quote
Administrators Farshad Mohajeri Posted May 23, 2014 Administrators Posted May 23, 2014 Or EdtCodigo.ClientEvents.ExtEvents.Values['afterrender']:='function(sender, eOpts) { }'); Quote
Administrators Farshad Mohajeri Posted May 23, 2014 Administrators Posted May 23, 2014 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; Quote
David Oliveira Posted May 23, 2014 Author Posted May 23, 2014 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! Quote
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.