[CLOSED] Panel Collapsed detection in Viewport

  1. #1

    [CLOSED] Panel Collapsed detection in Viewport

    What is incorrect here? For some reason calling WestPanel.Collapsed is not returning the correct answer in the ClickJustCheck direct event (see note #2).

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">
        protected void ClickJustCheck(object sender, DirectEventArgs e)
        {
            X.Msg.Alert("Just Check", "Collapsed - " + WestPanel.Collapsed.ToString()).Show();
        }
    
        protected void ClickHideCheck(object sender, DirectEventArgs e)
        {
            WestPanel.Collapse();
            X.Msg.Alert("Hide - Check", "Collapsed - " + WestPanel.Collapsed.ToString()).Show();
        }
    
        protected void ClickShowCheck(object sender, DirectEventArgs e)
        {
            WestPanel.Expand();
            X.Msg.Alert("Show - Check", "Collapsed - " + WestPanel.Collapsed.ToString()).Show();
        }
    
    </script>
    <!DOCTYPE html >
    <html>
    <head id="Head1" runat="server">
        <title>Collapse Check</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
            <Items>
                <ext:Panel ID="WestPanel" runat="server" ClientIDMode="Static" Region="West" Width="200"
                    Title="West" Collapsible="true" />
                <ext:Panel ID="CenterPanel" runat="server" Region="Center" Title="Center">
                    <Items>
                        <ext:Button runat="server" Text="Hide - Check" OnDirectClick="ClickHideCheck" />
                        <ext:Button runat="server" Text="Show - Check" OnDirectClick="ClickShowCheck" />
                        <ext:Button runat="server" Text="Just Check" OnDirectClick="ClickJustCheck" />
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </body>
    </html>
    Last edited by Daniil; Apr 09, 2013 at 4:07 AM. Reason: [CLOSED]
  2. #2
    OK, I see that Collapsed is a config method. Looks like there is a getCollapsed method "Returns the current collapsed state of the panel", but I can see it on the server side. What am I missing?

    I know I could pass a parameter from the client side
    App.WestPanel.getCollapsed()
    to any DirectEvent, but it would be nice from the server side just to ask the control if it is collapsed.
    Last edited by cwolcott; Apr 02, 2013 at 5:44 PM.
  3. #3
    Hi,

    - you have no form therefore there is no automatic submit
    - the bug with collapsed state is fixed in SVN, please update and retest
    Vladimir Shcheglov
    Sr. Developer
  4. #4
    Also please note that Collapse/Expand methods don't change current state on the server because those methods generate scripts only (state will be changed on client side after script execution only)
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] Rendering a ViewPort with south region collapsed
    By RCN in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 17, 2012, 1:59 PM
  2. [CLOSED] Title on a collapsed Panel
    By sisa in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 06, 2012, 6:42 AM
  3. Replies: 0
    Last Post: Aug 01, 2012, 5:21 AM
  4. Replies: 1
    Last Post: Mar 13, 2012, 8:37 AM
  5. Replies: 0
    Last Post: May 27, 2009, 6:50 AM

Posting Permissions