Jump to content

Runtime javascript events and form property


araujoadanr

Recommended Posts

Dear community, some has similar trouble

I need use property value on CreateForm

I have a Base Form (this form has Toolbars, menu and option), but sometime I need Hide some button, or dont create via javascript.

I have trouble with javascript runtime control, and toolbuttons on the form.

the zip is a test case.

Capture.PNG

runtime.PNG

Create.zip

Link to comment
Share on other sites

12 hours ago, adan200 said:

Create.zip 26.49 kB · 0 downloads

Try these sequences of steps:

1. image.png.04901ded65ccd221ee5dbbbdb974ce38.png

2. 

procedure TUniForm1.UniFormCreate(Sender: TObject);
var
  EventoJs: string;
begin
//  if FHideOption = True then
//  begin
//    // None
//  end
//  else
//    begin
//      // Creo el evento para el javascript
//      EventoJs := 'function window.afterCreate(sender){sender.addTool([{'+
//           'xtype: ''button'','+
//           'text: ''Test button'','+
//           'iconCls: ''myicon'','+
//           'handler:function(){'+
//           'this.up(''window'').mask(''Wait...'');'+
//           'ajaxRequest(this.up(''window''),''test'',[]);'+
//           '}}]);}';
//
//      // Agrego al formulario
//      Self.ClientEvents.UniEvents.Values['window.afterCreate'] := EventoJs;
//    end;


end;

procedure TUniForm1.UniFormReady(Sender: TObject);
begin
  if not FHideOption then
  begin
    JSInterface.JSCall('header.insert', [1, UniButton1.JSControl], WebForm.JSWindow);
  end;
end;

 

Link to comment
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...