Jump to content

How do I make a Panel invisible by clicking a button on the client side


eduardosuruagy

Recommended Posts

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.

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!!

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...