Jump to content

Recommended Posts

Posted

If i use TuniPanel.collapsible=true then the UniPanel starts at runtime "open" ..

 

I use a workarround in my Mainform-onCreate:

UniSession.AddJS((self.Components[i] as TUniPanel).JSName+'.collapse();');

to close all TuniPanels with collapsible=true;

 

 

 

But this doesnt´t work in TUniFrames - onCreate ... cause "UniSession" ... is unknowen

 

 

Any suggestions ...

 

Thank you

 

 

Posted

ok ...  i made a dirty workaround for the TUniFrame - thing ;-)

 

procedure TMainForm.InsertFrame1(Name: string;wo:TuniPanel);
var i:Integer;
begin
  if FFrameName1=Name then Exit;
    FFrameName1:=Name;
    FreeAndNil(FCurrentFrame1);
    FCurrentFrame1:=TUniFrameClass(FindClass(Name)).Create(self);
    FCurrentFrame1.Align:=alClient;
    FCurrentFrame1.Parent:=wo;


      for i:=0 to FCurrentFrame1.ComponentCount-1 do
        begin
          if FCurrentFrame1.Components[i].ClassName = 'TUniPanel' then
          begin
            if (FCurrentFrame1.Components[i] as TUniPanel).Collapsible = true then
            begin
               UniSession.AddJS((FCurrentFrame1.Components[i] as TUniPanel).JSName+'.collapse();');
            end;
          end;
        end;
end;

hope anybody can use this .. :-)

..or has a better solution ..

 

Posted

Try add uniGUIApplication to uses clause of UniFrame

and 

use setTimeout

For example:

UniSession.AddJS('setTimeout(function(){'+pnl_dop.JSName+'.collapse()}, 10);');

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