[CLOSED] Anchor Layout Issue (IE)

Page 3 of 5 FirstFirst 12345 LastLast
  1. #21
    Quote Originally Posted by ihis_dev_centre View Post
    is it possible to remove the title header?
    Well, there is no such functionality in a AccordionLayout.

    I will try to prepare an example when you answer my question below.

    Quote Originally Posted by ihis_dev_centre View Post
    so the collapse/expand will be done with button in the toolbar calling the code behind?
    Please clarify why do you need to do these actions on a server side?

    I should understand it to suggest a solution.

    Quote Originally Posted by ihis_dev_centre View Post
    anyway it still not met the requirement actually, since the 2nd topbar are hidden when the 1st panel are shown.
    Hmm, I tested the example again - both toolbars are not hidden for me in all cases.
  2. #22
    Quote Originally Posted by Daniil View Post
    Well, there is no such functionality in a AccordionLayout.

    I will try to prepare an example when you answer my question below.



    Please clarify why do you need to do these actions on a server side?

    I should understand it to suggest a solution.



    Hmm, I tested the example again - both toolbars are not hidden for me in all cases.
    the server side actually only for collapsing/expanding the panel, i know this is can be done using javascript
    but we have certain condition that need to be checked via server side.
  3. #23
    Ok, I would suggest to take only that required condition from a server and then pass it back to a client to do required actions according to that condition.

    I would use a DirectMethod.

    Is it not a problem?
  4. #24
    Quote Originally Posted by Daniil View Post
    Ok, I would suggest to take only that required condition from a server and then pass it back to a client to do required actions according to that condition.

    I would use a DirectMethod.

    Is it not a problem?
    should be no problem. thanks

    *right now i just checked about 5-20 aspx pages, hope this behaviour acceptable for all aspx pages that i have
  5. #25
    I implemented a separate class MyAccordionLayout inherited from the original AccordionLayout class.

    Example
    <%@ Page Language="C#" %>
      
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        [DirectMethod]
        public bool IsAllowToogle()
        {
            return true;
        }
    </script>
      
    <!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 runat="server">
        <title>Ext.Net Example</title>
     
        <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
        <script type="text/javascript" src="resources/js/MyAccordionLayout.js"></script>
    
        <script type="text/javascript">
            var toggle = function (b) {
                var p = b.ownerCt.ownerCt;
                Ext.net.DirectMethods.IsAllowToogle({
                    success : function (r) {
                        if (r) {
                            p.toggleCollapse();
                        } else {
                            alert("blocked");
                        }
                    }
                });
            };
        </script>
         
        <style type="text/css">
            .ext-ie6 .x-column {
                padding: 0px !important;
            }
        </style>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel
                        runat="server"
                        Height="30"
                        Region="North"
                        Html="North" />
                    <ext:Panel
                        runat="server"
                        Region="Center"
                        Layout="myAccordion">
                        <Items>
                            <ext:Panel
                                runat="server"
                                Layout="ColumnLayout">
                                 <TopBar>
                                    <ext:Toolbar runat="server">
                                        <Items>
                                            <ext:Button runat="server" Text="Toogle" StandOut="true">
                                                <Listeners>
                                                    <Click Fn="toggle" />
                                                </Listeners>
                                            </ext:Button>
                                        </Items>
                                    </ext:Toolbar>
                                </TopBar>
                                <Items>
                                    <ext:Panel runat="server" ColumnWidth="0.40" Html="Column1" />
                                    <ext:Panel runat="server" ColumnWidth="0.60" Html="Column2" />
                                </Items>
                                <Listeners>
                                    <Collapse Handler="this.ownerCt.layout.setActiveItem(1);" />
                                </Listeners>
                            </ext:Panel>
                           <ext:Panel
                                runat="server"
                                Layout="ColumnLayout">
                                 <TopBar>
                                    <ext:Toolbar runat="server">
                                        <Items>
                                            <ext:Button runat="server" Text="Toogle" StandOut="true">
                                                <Listeners>
                                                    <Click Fn="toggle" />
                                                </Listeners>
                                            </ext:Button>
                                        </Items>
                                    </ext:Toolbar>
                                </TopBar>
                                <Items>
                                    <ext:Panel runat="server" ColumnWidth="0.40" Html="Column1" />
                                    <ext:Panel runat="server" ColumnWidth="0.60" Html="Column2" />
                                </Items>
                                <Listeners>
                                    <Collapse Handler="this.ownerCt.layout.setActiveItem(0);" />
                                </Listeners>
                            </ext:Panel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    MyAccordionLayout.js
    Ext.layout.MyAccordionLayout = Ext.extend(Ext.layout.AccordionLayout, {
        type : 'myaccordion',
    
        renderItem : function (c) {
            c.collapseEl = "body";
    
            if (this.animate === false) {
                c.animCollapse = false;
            }
            if (this.autoWidth) {
                c.autoWidth = true;
            }
            if (this.collapseFirst !== undefined) {
                c.collapseFirst = this.collapseFirst;
            }
            if (!this.activeItem && !c.collapsed) {
                this.setActiveItem(c, true);
            } else if (this.activeItem && this.activeItem != c) {
                c.collapsed = true;
            }
            Ext.layout.AccordionLayout.superclass.renderItem.apply(this, arguments);
            c.on('beforeexpand', this.beforeExpand, this);
        },
    
        onRemove : function (c) {
            Ext.layout.AccordionLayout.superclass.onRemove.call(this, c);
            c.un('beforeexpand', this.beforeExpand, this);
        },
    
        setItemSize : function (item, size) {
            if (this.fill && item) {
                var hh = 0,
                    i, ct = this.getRenderedItems(this.container),
                    len = ct.length,
                    p;
                for (i = 0; i < len; i++) {
                    if ((p = ct[i]) != item && !p.hidden) {
                        hh += p.topToolbar.getHeight();
                    }
                };
                size.height -= hh;
                item.setSize(size);
            }
        }
    });
    Ext.Container.LAYOUTS.myaccordion = Ext.layout.MyAccordionLayout;
  6. #26
    superb Daniil :)

    one small thing, basically i modify again your code to call directevent but not related to the layout.
    its turn out, everytime the panel collaping/expanding the columlayout seem reset, can provide script
    to adjust 50-50 on expand in toggle script?

    some of the pages having 3 panel, and i having difficulties on toggling between this three
    is the setActiveItem only for 1st load ?
  7. #27
    its turn out, everytime the panel collaping/expanding the columlayout seem reset, can provide script
    to adjust 50-50 on expand in toggle script?
    I can't reproduce it. Please provide more details.

    some of the pages having 3 panel, and i having difficulties on toggling between this three
    is the setActiveItem only for 1st load ?
    Well, I think you can just remove these Collapse listeners.
  8. #28
    here's the working code

        <ext:Viewport ID="Viewport_MultiPatient" runat="server" Layout="Center">
            <Items>
                <ext:BorderLayout ID="BorderLayout_MultiPatient" runat="server">
                    <North Split="true" Collapsible="false">
                        <ext:Panel ID="Panel_Header" runat="server" Layout="ColumnLayout" Height="30" Padding="2" Html="north">
                        </ext:Panel>
                    </North>
                    <Center>
                        <ext:Panel ID="Panel_Content" runat="server" Layout="myaccordion">
                            <Items>
                                <ext:Panel ID="Panel_Lab" runat="server" AnchorHorizontal="right" AnchorVertical="82%" Collapsed="false">
                                    <TopBar>
                                        <ext:Toolbar ID="Toolbar_LabMenuBar" runat="server">
                                            <Items>
                                                <ext:Button ID="Button_Toggler_LabLeft" runat="server" Icon="ApplicationGet">
                                                    <DirectEvents>
                                                        <Click OnEvent="ToggleButton_Clicked" After="TogglePanel">
                                                            <EventMask ShowMask="true" />
                                                            <ExtraParams>
                                                                <ext:Parameter Name="Panel" Value="LAB" />
                                                            </ExtraParams>
                                                        </Click>
                                                    </DirectEvents>
                                                </ext:Button>
                                            </Items>
                                        </ext:Toolbar>                                    
                                    </TopBar>
                                    <Items>
                                        <ext:ColumnLayout ID="ColumnLayout_LabContent" runat="server" Split="true" FitHeight="true">
                                            <Columns>
                                                <ext:LayoutColumn ColumnWidth="0.40">
                                                    <ext:Container ID="Container_LabContent_ResultList" runat="server" Layout="FitLayout">
                                                        <Items>
                                                            <ext:GridPanel Cls="grid-row-span" ID="GridPanel_Lab_ResultList" runat="server" IDMode="Explicit" EnableColumnMove="false">
                                                                <Store>
                                                                    <ext:Store ID="Store_Lab_ResultList" runat="server" AutoLoad="true" >
                                                                        <Reader>
                                                                            <ext:JsonReader IDProperty="RecordId">
                                                                                <Fields>
                                                                                    <ext:RecordField Name="RecordId" />
                                                                                </Fields>
                                                                            </ext:JsonReader>
                                                                        </Reader>
                                                                    </ext:Store>
                                                                </Store>    
                                                            </ext:GridPanel>
                                                        </Items>
                                                    </ext:Container>
                                                </ext:LayoutColumn>
                                                <ext:LayoutColumn ColumnWidth="0.60">
                                                    <ext:Container ID="Container_LabContent_ReportList" runat="server">
                                                        <Items>
                                                            
                                                        </Items>
                                                    </ext:Container>
                                                </ext:LayoutColumn>
                                            </Columns>
                                        </ext:ColumnLayout>
                                    </Items>
                                </ext:Panel>
                                <ext:Panel ID="Panel_Rad" runat="server" AnchorHorizontal="right" AnchorVertical="82%" Collapsed="true">
                                    <TopBar>
                                        <ext:Toolbar ID="Toolbar_Rad" runat="server">
                                            <Items>
                                                <ext:Button ID="Button_Toggler_RadLeft" runat="server" Icon="Application">
                                                    <DirectEvents>
                                                        <Click OnEvent="ToggleButton_Clicked" After="TogglePanel">
                                                            <EventMask ShowMask="true" />
                                                            <ExtraParams>
                                                                <ext:Parameter Name="Panel" Value="RAD" />
                                                            </ExtraParams>
                                                        </Click>
                                                    </DirectEvents>
                                                </ext:Button>
                                            </Items>
                                        </ext:Toolbar>                                                                        
                                    </TopBar>
                                    <Items>
                                        <ext:ColumnLayout ID="ColumnLayout_RadContent" runat="server" Split="true" FitHeight="true">
                                            <Columns>
                                                <ext:LayoutColumn ColumnWidth="0.40">
                                                    <ext:Container ID="Container_RadContent_ResultList" runat="server" Layout="FitLayout">
                                                        <Items>
                                                            <ext:GridPanel Cls="grid-row-span" ID="GridPanel_Rad_ResultList" runat="server" AutoRender="true" IDMode="Explicit" EnableColumnMove="false">
                                                                <Store>
                                                                    <ext:Store ID="Store_Rad_ResultList" runat="server" AutoLoad="true" RemoteSort="true">
                                                                        <Reader>
                                                                            <ext:JsonReader IDProperty="RecordId">
                                                                                <Fields>
                                                                                    <ext:RecordField Name="RecordId" />
                                                                                </Fields>
                                                                            </ext:JsonReader>
                                                                        </Reader>
                                                                    </ext:Store>
                                                                </Store>    
                                                            </ext:GridPanel>
                                                        </Items>
                                                    </ext:Container>
                                                </ext:LayoutColumn>
                                                <ext:LayoutColumn ColumnWidth="0.60">
                                                    <ext:Container ID="Container_RadContent_ReportList" runat="server">
                                                        <Items>
                                                                                                                
                                                        </Items>
                                                    </ext:Container>
                                                </ext:LayoutColumn>
                                            </Columns>
                                        </ext:ColumnLayout>
                                    </Items>
                                </ext:Panel>
                                <ext:Panel ID="Panel_Other" runat="server" AnchorHorizontal="right" AnchorVertical="82%" Collapsed="true">
                                    <TopBar>
                                        <ext:Toolbar ID="Toolbar_Other" runat="server">
                                            <Items>
                                                <ext:Button ID="Button_Toggler_OtherLeft" runat="server" Icon="Application">
                                                    <DirectEvents>
                                                        <Click OnEvent="ToggleButton_Clicked" After="TogglePanel">
                                                            <EventMask ShowMask="true" />
                                                            <ExtraParams>
                                                                <ext:Parameter Name="Panel" Value="OTHER" />
                                                            </ExtraParams>
                                                        </Click>
                                                    </DirectEvents>
                                                </ext:Button>
                                            </Items>
                                        </ext:Toolbar>                                                                        
                                    </TopBar>
                                    <Items>
                                        <ext:ColumnLayout ID="ColumnLayout_OtherContent" runat="server" Split="true" FitHeight="true">
                                            <Columns>
                                                <ext:LayoutColumn ColumnWidth="0.40">
                                                    <ext:Container ID="Container_OtherContent_ResultList" runat="server" Layout="FitLayout">
                                                        <Items>
                                                            <ext:GridPanel Cls="grid-row-span" ID="GridPanel_Other_ResultList" runat="server" IDMode="Explicit" EnableColumnMove="false">
                                                                <Store>
                                                                    <ext:Store ID="Store_Other_ResultList" runat="server" AutoLoad="true" RemoteSort="true">
                                                                        <Reader>
                                                                            <ext:JsonReader IDProperty="RecordId">
                                                                                <Fields>
                                                                                    <ext:RecordField Name="RecordId" />
                                                                                </Fields>
                                                                            </ext:JsonReader>
                                                                        </Reader>
                                                                    </ext:Store>
                                                                </Store>
                                                            </ext:GridPanel>                                                    
                                                        </Items>
                                                    </ext:Container>
                                                </ext:LayoutColumn>
                                                <ext:LayoutColumn ColumnWidth="0.60">
                                                    <ext:Container ID="Container_OtherContent_ReportList" runat="server">
                                                        <Items>
                                                                                                                                                                    
                                                        </Items>
                                                    </ext:Container>
                                                </ext:LayoutColumn>
                                            </Columns>
                                        </ext:ColumnLayout>
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:Panel>
                    </Center>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    code behind
            public void ToggleButton_Clicked(object sender, Ext.Net.DirectEventArgs e)
            {
                this.Button_Toggler_LabLeft.Icon = Ext.Net.Icon.Application;
                this.Button_Toggler_RadLeft.Icon = Ext.Net.Icon.Application;
                this.Button_Toggler_OtherLeft.Icon = Ext.Net.Icon.Application;
                
                decimal lpane = 0.40M;
                decimal rpane = 0.60M;
    
                this.ColumnLayout_LabContent.Columns[0].ColumnWidth = lpane;
                this.ColumnLayout_LabContent.Columns[1].ColumnWidth = rpane;
                
                this.ColumnLayout_RadContent.Columns[0].ColumnWidth = lpane;
                this.ColumnLayout_RadContent.Columns[1].ColumnWidth = rpane;
    
                this.ColumnLayout_OtherContent.Columns[0].ColumnWidth = lpane;
                this.ColumnLayout_OtherContent.Columns[1].ColumnWidth = rpane;
            }
    your script
    Ext.layout.MyAccordionLayout = Ext.extend(Ext.layout.AccordionLayout, {
        type : 'myaccordion',
     
        renderItem : function (c) {
            c.collapseEl = "body";
     
            if (this.animate === false) {
                c.animCollapse = false;
            }
            if (this.autoWidth) {
                c.autoWidth = true;
            }
            if (this.collapseFirst !== undefined) {
                c.collapseFirst = this.collapseFirst;
            }
            if (!this.activeItem && !c.collapsed) {
                this.setActiveItem(c, true);
            } else if (this.activeItem && this.activeItem != c) {
                c.collapsed = true;
            }
            Ext.layout.AccordionLayout.superclass.renderItem.apply(this, arguments);
            c.on('beforeexpand', this.beforeExpand, this);
        },
     
        onRemove : function (c) {
            Ext.layout.AccordionLayout.superclass.onRemove.call(this, c);
            c.un('beforeexpand', this.beforeExpand, this);
        },
     
        setItemSize : function (item, size) {
            if (this.fill && item) {
                var hh = 0,
                    i, ct = this.getRenderedItems(this.container),
                    len = ct.length,
                    p;
                for (i = 0; i < len; i++) {
                    if ((p = ct[i]) != item && !p.hidden) {
                        hh += p.topToolbar.getHeight();
                    }
                };
                size.height -= hh;
                item.setSize(size);
            }
        }
    });
    Ext.Container.LAYOUTS.myaccordion = Ext.layout.MyAccordionLayout;
            var TogglePanel = function (b) {
                var p = b.ownerCt.ownerCt;
                p.toggleCollapse();
            };
  9. #29
    I'm not sure that I understand the problem or what you are trying to achieve.

    One thing I can say - setting up .ColumnWidth during a DirectEvent doesn't make any sense.

    I guess ColumnLayout re-layouting annoys then you expand a panel, isn't that so?

    If so, please try to set up HideMode="Offsets" for the Panels with a ColumnLayout.
  10. #30
    please refer to the screenshot below

    i try to add hidemode, still not helping.

Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Replies: 2
    Last Post: Jun 11, 2012, 2:40 PM
  2. [CLOSED] Layout issue
    By alliedwallet.com in forum 1.x Premium Help
    Replies: 4
    Last Post: Oct 14, 2011, 4:36 PM
  3. [CLOSED] Layout Issue
    By rnachman in forum 1.x Premium Help
    Replies: 2
    Last Post: Sep 28, 2011, 5:37 PM
  4. [CLOSED] Column Layout inside Anchor
    By ljcorreia in forum 1.x Premium Help
    Replies: 1
    Last Post: Jun 22, 2011, 1:25 PM
  5. [CLOSED] Layout issue
    By Etisbew in forum 1.x Premium Help
    Replies: 4
    Last Post: Jul 01, 2009, 7:02 AM

Tags for this Thread

Posting Permissions