eduardosuruagy Posted April 21, 2020 Share Posted April 21, 2020 How do I make a Panel invisible by clicking a button on the client side Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 21, 2020 Share Posted April 21, 2020 10 minutes ago, eduardosuruagy said: How do I make a Panel invisible by clicking a button on the client side Why not use the server side for this? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 21, 2020 Author Share Posted April 21, 2020 1 minute ago, Sherzod said: Por que não usar o lado do servidor para isso? Wouldn't it be faster on the client side? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 21, 2020 Share Posted April 21, 2020 Well, if you do not take into account the status of the panel on the server side, then yes, you can use the operation on the client side. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 21, 2020 Author Share Posted April 21, 2020 16 minutes ago, Sherzod said: Bem, se você não levar em consideração o status do painel no lado do servidor, sim, poderá usar a operação no lado do cliente. I have a panel that has a width of zero 0, then I click the button and change the size to 300, all on the server side, but sometimes there is a delay in this process. Then I was wondering if you can do it on the client's side, or making it visible and invisible or changing its size. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 21, 2020 Share Posted April 21, 2020 procedure TMainForm.UniFormCreate(Sender: TObject); begin UniButton1.JSInterface.JSAddListener('click', 'function(){'+ UniPanel1.JSName +'.hide()}'); end; Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 21, 2020 Author Share Posted April 21, 2020 1 hour ago, Sherzod said: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniButton1.JSInterface.JSAddListener('click', 'function(){'+ UniPanel1.JSName +'.hide()}'); end; and to make it visible? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 21, 2020 Author Share Posted April 21, 2020 and to make it visible? Quote Link to comment Share on other sites More sharing options...
gerardocrisci Posted April 21, 2020 Share Posted April 21, 2020 procedure TMainForm.UniFormCreate(Sender: TObject); begin UniButton1.JSInterface.JSAddListener( 'click', 'function(){'+ UniPanel1.JSName +'.setVisible(!'+ UniPanel1.JSName +'.isVisible())'+ '}' ); end; i think you want to create a switch between visible and invisible 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 21, 2020 Share Posted April 21, 2020 27 minutes ago, eduardosuruagy said: and to make it visible? .show(); ? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 21, 2020 Author Share Posted April 21, 2020 11 minutes ago, gerardocrisci said: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniButton1.JSInterface.JSAddListener( 'click', 'function(){'+ UniPanel1.JSName +'.setVisible(!'+ UniPanel1.JSName +'.isVisible())'+ '}' ); end; i think you want to create a switch between visible and invisible That's right Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted April 21, 2020 Author Share Posted April 21, 2020 16 minutes ago, gerardocrisci said: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniButton1.JSInterface.JSAddListener( 'click', 'function(){'+ UniPanel1.JSName +'.setVisible(!'+ UniPanel1.JSName +'.isVisible())'+ '}' ); end; i think you want to create a switch between visible and invisible Thank you very much!! Quote Link to comment Share on other sites More sharing options...
gerardocrisci Posted April 21, 2020 Share Posted April 21, 2020 7 minutes ago, eduardosuruagy said: Thank you very much!! if you liked it, give it a "Like" Ciao. 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.