araujoadanr Posted October 3, 2021 Share Posted October 3, 2021 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. Create.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 4, 2021 Share Posted October 4, 2021 Hello, You can also do it differently. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 4, 2021 Share Posted October 4, 2021 12 hours ago, adan200 said: Create.zip 26.49 kB · 0 downloads Try these sequences of steps: 1. 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; Quote Link to comment Share on other sites More sharing options...
araujoadanr Posted October 4, 2021 Author Share Posted October 4, 2021 thank you very much... works fine... 1 Quote Link to comment Share on other sites More sharing options...
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.