PDA

View Full Version : [CLOSED] CycleButton to switch Panel in ViewPort East



xtoolz
Apr 24, 2014, 3:33 PM
Hi all

I need to show two Panels in a ViewPorts East region. The visability of the two panels should be switched with a CycleButton.
The CycleButton should be placed on the top of the East Region (normal button height ~25px) and the Panel below should fill the rest of the region...

I can do what I want - I can't get it :-(


<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="panGrid" runat="server" Region="Center">
<Items>
</Items>
</ext:Panel>
<ext:Container ID="cntDetail" runat="server" Title="East" Region="East" Width="225" Layout="FormLayout">
<Items>
<ext:Panel ID="panSelector" Border="true" Height="25" Layout="BorderLayout">
<Items>
<ext:CycleButton ID="cmdMode" runat="server" ShowText="true" PrependText="Mode : ">
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:CheckMenuItem ID="mnuIndividual" runat="server" Text="Individual" Icon="User">
<Listeners>
<Click Handler="changeMode(item, e);"></Click>
</Listeners>
</ext:CheckMenuItem>
<ext:CheckMenuItem ID="mnuCompany" runat="server" Text="Company" Icon="House" Checked="true">
<Listeners>
<Click Handler="changeMode(item, e);"></Click>
</Listeners>
</ext:CheckMenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:CycleButton>
</Items>
</ext:Panel>
<ext:Container runat="server" Layout="Fitlayout">
<Items>
<ext:FormPanel runat="server" ID="pnlIndividual" Layout="Fit" Hidden="true">
<Items>
<ext:Label runat="server" Text="Individual" />
</Items>
</ext:FormPanel>
<ext:FormPanel runat="server" ID="pnlCompany" Layout="Fit">
<Items>
<ext:Label ID="Label1" runat="server" Text="Company" />
</Items>
</ext:FormPanel>
</Items>
</ext:Container>

</Items>
</ext:Container>

</Items>
</ext:Viewport>

Any help is welcome !

Peter

geoffrey.mcgill
Apr 24, 2014, 5:07 PM
Hi Peter,

I think you should use CardLayout instead of Fitlayout. The FitLayout only allows for one Container inside the Parent, but the CardLayout allows for many. The CardLayout is used by the TabPanel Component.


<ext:Container runat="server" Layout="CardLayout">

Hope this helps.

xtoolz
Apr 25, 2014, 12:22 PM
Hi Peter,

I think you should use CardLayout instead of Fitlayout. The FitLayout only allows for one Container inside the Parent, but the CardLayout allows for many. The CardLayout is used by the TabPanel Component.


<ext:Container runat="server" Layout="CardLayout">

Hope this helps.

That was the Solution !
Thank you...

Peter