[CLOSED] Toggle Panel substr error

  1. #1

    [CLOSED] Toggle Panel substr error

    Hi,

    With new revision I found a problem with a custom case to expand or collapse panel.

    This is my test case:

    TEST CASE

    ASPX
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>GridPanel with FitLayout - Ext.NET Examples</title>
        <script type="text/javascript">
            var isPanelWorking = false;
        var onToggle = function () {
            if (isPanelWorking == false) {
                isPanelWorking = true;
                var wasCollapsed = pnlAsigMasiva.collapsed != false;
    
                if (wasCollapsed)
                    pnlAsigMasiva.expand();
                else
                    pnlAsigMasiva.collapse("bottom", true);
    
                isPanelWorking = false;
            }
        }
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />    
        <ext:Viewport runat="server" Layout="FitLayout" Border="false">
            <Items>
                <ext:Panel runat="server" Border="false" Layout="BorderLayout">
                    <Items>
                    <ext:Panel runat="server" Border="false" Region="Center">
                        <Items>
                            <ext:Button runat="server" Text="Expand/Collapse">
                            <Listeners>
                                <Click Fn="onToggle" />
                            </Listeners>
                        </ext:Button>
                        </Items>
                    </ext:Panel>
                        <ext:Panel ID="pnlAsigMasiva" runat="server" Layout="FitLayout" Collapsed="true"
                            Collapsible="true" Height="300" Region="South" Title="Collapsed Panel"
                            Split="true" Hidden="false">
                            <Items>
                                <ext:Label runat="server" Text="My Text in Panel" />
                            </Items>
                            <Listeners>
                                <BeforeCollapse Fn="onToggle" />
                                <BeforeExpand Fn="onToggle" />
                            </Listeners>
                        </ext:Panel>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>  
        </form>
    </body>
    </html>
    As I see my buttom works well as expected but pressing panel expand button now internally fires toggleButton function and when this delegates to expand method without parameter internally pass a true in animate parameter and crashes when it does a substr of this boolean. I don't know if this is the error.

    Thanks
    Last edited by Daniil; Sep 21, 2012 at 10:29 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I think it is not well designed to call the collapse and expand methods within the BeforeCollapse and BeforeExpand listeners.

    Though, it should function well, if you would prevent a default action returning false from the listener.

    Example
    var onToggle = function () {
        if (isPanelWorking == false) {
            /* you code here */
    
            return false;
        }
    };
  3. #3
    Yes, you are right, with return false now works like in the past.

    Thanks

Similar Threads

  1. [CLOSED] GridCommand toggle functionality
    By blueworld in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 29, 2012, 2:31 PM
  2. Toggle GridPanel Paging On/Off
    By kumbahara in forum 1.x Help
    Replies: 0
    Last Post: Nov 17, 2010, 8:42 PM
  3. toggle event of groupingsummary
    By fotis in forum 1.x Help
    Replies: 0
    Last Post: Mar 09, 2010, 3:34 PM
  4. [FIXED] [1.0] SetClassIcon Toggle Bug?
    By kylecm in forum Bugs
    Replies: 2
    Last Post: Jan 07, 2010, 1:44 PM
  5. [CLOSED] Toggle Button
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 07, 2008, 3:09 PM

Tags for this Thread

Posting Permissions