Jump to content

TUniPanel - Collapsible Problem ...


erich.wanker

Recommended Posts

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

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...