[CLOSED] AccordionLayout and hiding items

  1. #1

    [CLOSED] AccordionLayout and hiding items

    What is the correct way to hide/show panels in an AccordionLayout and still have the expand/collapse work properly. The code below can demonstrate the issue.

    a) Execute the code and you will see four panels. Press the "Hide 4th Panel" button and the last panel will be hidden. If you expand the 3rd panel and then collapse it you would expect the 2nd panel to expand, but in this case no panels are expanded because it is expecting the 4th panel to be shown.

    b) Even a little more strange. Execute the code and you will see four panels. Expand 4th Panel, Press "Hide 4th Panel" button, Expand 1st Panel, Press "Show 4th Panel" button, Expand 2nd Panel. The 2nd panel expands, but the 1st panel is still shown.

    Any thoughts?

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>AccordionLayout - Issue</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <h1>Accordion Layout in Markup</h1>
    
        <ext:Window
            runat="server"
            Title="Accordion"
            Width="250"
            Height="400"
            Maximizable="true"
            BodyBorder="0"
            Icon="ApplicationTileVertical"
            Layout="Accordion">
            <TopBar>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button ID="HideStuff" runat="server" Text="Hide 4th Panel" Icon="BulletDelete"
                            OnClientClick="App.Panel4.hide();" />
                        <ext:Button ID="ShowMyStuff" runat="server" Text="Show 4th Panel" Icon="BulletAdd"
                            OnClientClick="App.Panel4.show();" />
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <Items>
                <ext:TreePanel runat="server" Title="1st Panel" RootVisible="false">
                    <Root>
                        <ext:Node Text="Root">
                            <Children>
                                <ext:Node Text="Friends" Expanded="true">
                                    <Children>
                                        <ext:Node Text="George" Icon="User" Leaf="True" />
                                        <ext:Node Text="Brian" Icon="User" Leaf="True" />
                                    </Children>
                                </ext:Node>
                                <ext:Node Text="Family" Expanded="true">
                                    <Children>
                                        <ext:Node Text="Kelly" Icon="UserFemale" Leaf="True" />
                                    </Children>
                                </ext:Node>
                            </Children>
                        </ext:Node>
                    </Root>
                </ext:TreePanel>
                <ext:Panel ID="Panel2" runat="server" Title="2nd Panel" Html="2nd Panel" />
                <ext:Panel ID="Panel3" runat="server" Title="3rd Panel" Html="3rd Panel" />
                <ext:Panel ID="Panel4" runat="server" ClientIDMode="Static" Title="4th Panel" Html="4th Panel" />
            </Items>
        </ext:Window>
    </body>
    </html>
    Last edited by Daniil; Oct 13, 2014 at 3:09 PM. Reason: [CLOSED]
  2. #2
    Hi Chris,

    Yes, AccordionLayout doesn't "like" hiding, showing, removing its items on the fly.
    https://github.com/extnet/Ext.NET/issues/269
    https://github.com/extnet/Ext.NET/issues/342

    The only solid solution we can suggest here is to recreate/rerender the entire accordion panel with the new setup.
  3. #3
    That sucks. So for my application I created a second accordion panel (AdminPanel) that includes all the administrator subPanels and just hide the AdminPanel if the user does not have the role rather than the individual panels in the accordion panel. The AdminPanel is part of the west panel with a height of 175 and the old accordion panel has a flex of 1.

    I might eventually look at rebuilding the entire west panel after each login, but this was the quickest way to continue.

    Please close the thread.

Similar Threads

  1. [CLOSED] UserControls in AccordionLayout
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 13, 2014, 2:57 PM
  2. [CLOSED] AccordionLayout Panels with Tools
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 22, 2014, 6:15 PM
  3. Replies: 3
    Last Post: Dec 13, 2012, 9:15 PM
  4. [2.0] Menu problem with AccordionLayout
    By GolineTidus in forum 2.x Help
    Replies: 1
    Last Post: Dec 03, 2012, 2:29 AM
  5. [CLOSED] Refresh issue with AccordionLayout panel.
    By bossun in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 17, 2012, 9:31 PM

Posting Permissions