[CLOSED] Using Accordion to switch between panels in center. Height and width only set on initally displayed panel

  1. #1

    [CLOSED] Using Accordion to switch between panels in center. Height and width only set on initally displayed panel

    This is an example of the core functionallity of the main interface of my application.

    In my app the three accordion panels contain two tree views and a search form.

    Originally I used one panel with an auto load Iframe in the center but this was too slow. Thus I have changed to the current design. All works well except only the originally visible center panel has the correct height and width. The others never get set. Is there any way I can force these panels to occupy the full screen area when they are displayed?

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title runat="server" id="pageTitle"></title>
        <link href="Stylesheet.css" rel="Stylesheet" type="text/css" />
    
        <script language="javascript" type="text/javascript">
          function defaultShowSection(lSectionID)
          {
              switch (lSectionID)
              {
                  case 1:
                  {
                      frmMainPanel.show();
                      frmSearchPanel.hide();
                      frmAdminPanel.hide();
                      break;
                  }
                  case 2:
                  {
                      frmMainPanel.hide();
                      frmSearchPanel.show();
                      frmAdminPanel.hide();
                      break;
                  }
                  case 3:
                  {
                      frmMainPanel.hide();
                      frmSearchPanel.hide();
                      frmAdminPanel.show();
                      break;
                  }
              }
          }
        </script>
    
    </head>
    <body oncontextmenu="return false;">
        <form id="form1" runat="server">
        <ext:ResourceManager ID="smrMain" runat="server">
        </ext:ResourceManager>
        <ext:Viewport runat="server" ID="vwDefault">
            <Items>
                <ext:BorderLayout ID="Borderlayout1" runat="server">
                    <West AnimFloat="false" Floatable="false" MinWidth="200" MaxWidth="300" Split="true">
                        <ext:Panel HideBorders="true" runat="server" ID="frmNavigation" Floating="false"
                            Width="200" Title="Navigation" AnimCollapse="false" Collapsed="false" Collapsible="true">
                            <Content>
                                <ext:AccordionLayout ID="AccordionLayout1" HideCollapseTool="true" AutoWidth="true"
                                    runat="server">
                                    <Items>
                                        <ext:Panel runat="server" ID="panel1" Title="Google">
                                            <Listeners>
                                                <Expand Handler="defaultShowSection(1);" />
                                            </Listeners>
                                        </ext:Panel>
                                        <ext:Panel runat="server" ID="panel2" Title="Ext.Net Examples">
                                            <Listeners>
                                                <Expand Handler="defaultShowSection(2);" />
                                            </Listeners>
                                        </ext:Panel>
                                        <ext:Panel runat="server" ID="panel3" Title="Extjs Documentation">
                                            <Listeners>
                                                <Expand Handler="defaultShowSection(3);" />
                                            </Listeners>
                                        </ext:Panel>
                                    </Items>
                                </ext:AccordionLayout>
                            </Content>
                        </ext:Panel>
                    </West>
                    <Center>
                        <ext:Container ID="CenterPanel" runat="server" ForceLayout="true" Layout="Fit">
                            <Content>
                                <ext:Panel ForceLayout="true" HideBorders="true" runat="server" ID="frmMainPanel"
                                    Layout="Fit">
                                    <AutoLoad Mode="IFrame" Url="http://www.google.co.uk/" ShowMask="true" MaskMsg="Loading Home Page ...">
                                    </AutoLoad>
                                </ext:Panel>
                                <ext:Panel ForceLayout="true" HideBorders="true" runat="server" ID="frmSearchPanel"
                                    Layout="Fit" Hidden="true">
                                    <AutoLoad Mode="IFrame" Url="https://examples2.ext.net/" ShowMask="true" MaskMsg="Searching...">
                                    </AutoLoad>
                                </ext:Panel>
                                <ext:Panel ForceLayout="true" HideBorders="true" runat="server" ID="frmAdminPanel"
                                    Layout="Fit" Hidden="true">
                                    <AutoLoad Mode="IFrame" Url="http://www.extjs.com/deploy/dev/docs/" ShowMask="true"
                                        MaskMsg="Loading Home Page ...">
                                    </AutoLoad>
                                </ext:Panel>
                            </Content>
                        </ext:Container>
                    </Center>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
        </form>
    </body>
    </html>
  2. #2

    RE: [CLOSED] Using Accordion to switch between panels in center. Height and width only set on initally displayed panel

    Hi,

    Try to use Card layout
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title runat="server" id="pageTitle"></title>
    
        <script language="javascript" type="text/javascript">
    
            function defaultShowSection(lSectionID) {
                CenterPanel.layout.setActiveItem(lSectionID);
            }
        
        </script>
    
    </head>
    <body oncontextmenu="return false;">
        <form id="form1" runat="server">
            <ext:ResourceManager ID="smrMain" runat="server">
            </ext:ResourceManager>
            
            <ext:Viewport runat="server" ID="vwDefault">
                <Items>
                    <ext:BorderLayout ID="Borderlayout1" runat="server">
                        <West AnimFloat="false" Floatable="false" MinWidth="200" MaxWidth="300" Split="true">
                            <ext:Panel HideBorders="true" runat="server" ID="frmNavigation" Floating="false"
                                Width="200" Title="Navigation" AnimCollapse="false" Collapsed="false" Collapsible="true">
                                <Content>
                                    <ext:AccordionLayout ID="AccordionLayout1" HideCollapseTool="true" AutoWidth="true"
                                        runat="server">
                                        <Items>
                                            <ext:Panel runat="server" ID="panel1" Title="Google">
                                                <Listeners>
                                                    <Expand Handler="defaultShowSection(0);" />
                                                </Listeners>
                                            </ext:Panel>
                                            <ext:Panel runat="server" ID="panel2" Title="Ext.Net Examples">
                                                <Listeners>
                                                    <Expand Handler="defaultShowSection(1);" />
                                                </Listeners>
                                            </ext:Panel>
                                            <ext:Panel runat="server" ID="panel3" Title="Extjs Documentation">
                                                <Listeners>
                                                    <Expand Handler="defaultShowSection(2);" />
                                                </Listeners>
                                            </ext:Panel>
                                        </Items>
                                    </ext:AccordionLayout>
                                </Content>
                            </ext:Panel>
                        </West>
                        <Center>
                            <ext:Container ID="CenterPanel" runat="server" Layout="Card" ActiveIndex="0">
                                <LayoutConfig>
                                    <ext:CardLayoutConfig LayoutOnCardChange="true" />
                                </LayoutConfig>
                                <Items>
                                    <ext:Panel HideBorders="true" runat="server" ID="frmMainPanel"
                                        Layout="Fit">
                                        <AutoLoad Mode="IFrame" Url="http://www.google.co.uk/" ShowMask="true" MaskMsg="Loading Home Page ...">
                                        </AutoLoad>
                                    </ext:Panel>
                                    <ext:Panel HideBorders="true" runat="server" ID="frmSearchPanel"
                                        Layout="Fit">
                                        <AutoLoad Mode="IFrame" Url="https://examples2.ext.net/" ShowMask="true" MaskMsg="Searching...">
                                        </AutoLoad>
                                    </ext:Panel>
                                    <ext:Panel HideBorders="true" runat="server" ID="frmAdminPanel"
                                        Layout="Fit">
                                        <AutoLoad Mode="IFrame" Url="http://www.extjs.com/deploy/dev/docs/" ShowMask="true"
                                            MaskMsg="Loading Home Page ...">
                                        </AutoLoad>
                                    </ext:Panel>
                                </Items>
                            </ext:Container>
                        </Center>
                    </ext:BorderLayout>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] [1.2] Switch panels?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 01, 2011, 3:57 PM
  2. Replies: 1
    Last Post: Sep 22, 2011, 11:38 AM
  3. Replies: 1
    Last Post: May 14, 2011, 10:51 AM
  4. Replies: 2
    Last Post: Feb 17, 2011, 2:16 AM
  5. Replies: 15
    Last Post: Jul 19, 2010, 10:15 PM

Posting Permissions