Page 1 of 1

InitClosed problem

PostPosted: 27 Oct 2016 16:10
by Eric.P
Hi CGDevtools !

I have a button where i create 2 layoutpanelregion on a layout component (present in design time) in the click event.
The first is alRight, initClosed width 200 with an accordion component inside
The last is alClient with a grid inside

When i click on the button, the layoutpanel alClient doesn't take all the place as expected but left a white space with 200 width (where should be the first layout if he was opened), the splitter on the layout iniclosed is on the right as expected,

see img1

when i open the splitter and reclose it, the layout alClient take all the place.

see img3

Is there something wrong with my code ? i expected to have the img3

Code: Select all
uses
  Unit2, Unit3, IWCGAsyncRender;


procedure TIWForm1.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
  AParams: TStringList);
var
  lNewPanel, lNewPanel2:TIWCGJQLayoutPanelRegion;
  lFraGrid:TIWFrame2;
  lFraAcc:TIWFrame3;
begin
  IWCGJQLayout1.Align := alClient;
  IWCGJQLayout1.Visible := true;

  lNewPanel := IWCGJQLayout1.AddNewPanel;
  lNewPanel.Name := 'PanelAcc';
  lNewPanel.Align := alRight;
  lNewPanel.Width := 200;
  lNewPanel.PanelOptions.InitClosed := true;
  //lNewPanel.PanelOptions.ClosePanel;

  lFraAcc := TIWFrame3.Create(lNewPanel);
  lFraAcc.Parent := lNewPanel;
  lFraAcc.Align := alClient;

  lNewPanel2 := IWCGJQLayout1.AddNewPanel;
  lNewPanel2.Name := 'PanelGrid';
  lNewPanel2.Align := alClient;
  lFraGrid := TIWFrame2.Create(lNewPanel2);
  lFraGrid.Parent := lNewPanel2;
  lFraGrid.Align := alClient;

  RenderRegionAsync(IWCGJQLayout1);
end;

Re: InitClosed problem

PostPosted: 27 Oct 2016 18:14
by Alexander Bulei
Hi,

Try to call the RenderRegionAsync with parameters:

Code: Select all
  RenderRegionAsync(IWCGJQRegion1,False,True);


Best Regards.

Re: InitClosed problem

PostPosted: 28 Oct 2016 14:32
by Eric.P
Ty Alexander,

it works perfectly.

Regards