[CLOSED] Layout Fit not working properly

  1. #1

    [CLOSED] Layout Fit not working properly

    Please see the attached example.

    ext.1.7

    1. open page
    2. click ICON (don't expand it will crash since is standalone)
    3. SOUTH panel will expand.

    PROBLEM #1
    expected. layout fit should apply
    actual: layout fit not applied.

    Now remove the entire formPanel in the tab and repeat. Magically, it works perfects.

    PROBLEM #2
    1. do steps 1-3
    2. click the Add E button.

    expected: form loads properly.
    actual: form loads incorrectly.

    Please assist to determine when it fails with the formPanel.

    Thanks!
    /Z

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaticTest.aspx.cs" Inherits="Crystal.Views.Support.StaticTest" %>
    <%@ Import Namespace="Crystal" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ 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></title>
        <style type="text/css">
            .red-text {
                color     : red;
                font-size : large;
            }
            
            .blue-text {
                color     : blue;
                font-size : large;
            }
        </style>
        <script type="text/javascript">
            var renderEsAssigned = function (node) {
                var grid = Ext.getCmp("GridPanelEsAssigned");
                grid.render();
                grid.store.load();
            };
     
            var showDetailPanel = function (node, store, isNew) {
                if (node == null) {
                    //noop
                } else {
                    var nodeId = node.id;
                    var nodeText = node.text;
                    if (nodeId != null) {
                        store.load({
                            callback: function (a, b, c) {
                                //expand the panel
                                Ext.getCmp("TabPanelADetails").setHeight(400);
                                Ext.getCmp("TabPanelADetails").expand();
                                Ext.getCmp("ViewportModel").doLayout();
                            }
                        });
                    }
                }
            };
     
    
        </script>
    
    <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new List<Company> 
             { 
                 new Company(1, "3m Co", 71.72, 0.02, 0.03, true),
                 new Company(2, "Alcoa Inc", 29.01, 0.42, 1.47, true),
                 new Company(3, "Altria Group Inc", 83.81, 0.28, 0.34, true),
                 new Company(4, "American Express Company", 52.55, 0.01, 0.02, true),
                 new Company(5, "American International Group, Inc.", 64.13, 0.31, 0.49, true),
                 new Company(6, "AT&T Inc.", 31.61, -0.48, -1.54, true),
                 new Company(7, "Boeing Co.", 75.43, 0.53, 0.71, true),
                 new Company(8, "Caterpillar Inc.", 67.27, 0.92, 1.39, true),
                 new Company(9, "Citigroup, Inc.", 49.37, 0.02, 0.04, true),
                 new Company(10, "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, true),
                 new Company(11, "Exxon Mobil Corp", 68.1, -0.43, -0.64, true),
                 new Company(12, "General Electric Company", 34.14, -0.08, -0.23, true),
                 new Company(13, "General Motors Corporation", 30.27, 1.09, 3.74, true),
                 new Company(14, "Hewlett-Packard Co.", 36.53, -0.03, -0.08, true),
                 new Company(15, "Honeywell Intl Inc", 38.77, 0.05, 0.13, true),
                 new Company(16, "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, true)
             };
            this.Store1.DataBind();
        }
        public class Company
        {
            public Company(long id, string name, double price, double change, double pctChange, bool checkedVal)
            {
                this.id = id;
                this.Name = name;
                this.Price = price;
                this.Change = change;
                this.PctChange = pctChange;
                this.checkedVal = checkedVal;
            }
            public long id { get; set; }
            public string Name { get; set; }
            public double Price { get; set; }
            public double Change { get; set; }
            public double PctChange { get; set; }
            public bool checkedVal { get; set; }
        }
    </script>
    
    </head>
    <body>
    <form id="AddNodeForm" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server"/>
        <ext:Store ID="Store1" runat="server">
            <Reader>
                <ext:JsonReader IDProperty="id">
                    <Fields>
                        <ext:RecordField Name="id" />
                        <ext:RecordField Name="Name" />
                        <ext:RecordField Name="Price" />
                        <ext:RecordField Name="Change" />
                        <ext:RecordField Name="PctChange" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Viewport ID="ViewportModel" runat="server" Layout="FitLayout">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server" >
                    <Center>
                        <ext:Panel runat="server"
                                ID="CenterPanel"
                                Layout="FitLayout"
                                Anchor="100% 100%"
                                AutoWidth="true"> 
                            <Items>
                                <ext:TreePanel 
                                    ID="TreePanelAs" 
                                    runat="server" 
                                    Title="A" 
                                    RootVisible="true"
                                    Layout="FitLayout"
                                    Anchor="100% 100%"
                                    Width="600"
                                    Icon="Neighbourhood"
                                    Border="false"
                                    AutoScroll="true"
                                    UseArrows="true"
                                    EnableDD="false">     
                                
                                    <Sorter FolderSort="true" />
                                    <Root>
                                        <ext:AsyncTreeNode AutoDataBind="true" Icon="UserHome " AllowDrag="false" Draggable = "false" NodeID="1" Text="1"  />
                                    </Root>
                                    <Listeners>
                                        <Click Handler="showDetailPanel(node, #{Store1}, 'N');" />
                                    </Listeners>
                                </ext:TreePanel>
                            </Items>
                        </ext:Panel>
                    </Center>
                    <South Split="true">
                        <ext:TabPanel 
                            ID="TabPanelADetails" 
                            runat="server" 
                            Anchor="100% 100%"
                            Height="500"
                            Collapsible="true" 
                            Title="Detail Panel"
                            AnimCollapse="false"
                            Collapsed="true"
                            CollapseMode="Default"
                            ActiveTabIndex="0">
                            <Listeners>
                                <Expand Handler="#{TreePanelAs}.disable();"/>
                                <Collapse Handler="#{TreePanelAs}.enable();"/>
                            </Listeners>
                            <Items>
                                <ext:Panel  Layout="FitLayout" runat="server" AutoWidth="true" ActiveIndex="2" ID="EPanel" Border="False" Title="Es">
                                    <Listeners>
                                        <Activate Single="true"  Fn="renderEsAssigned" />
                                    </Listeners>
                                    <Items>
                                        <ext:FormPanel 
                                            ID="FormPanelS" 
                                            runat="server" 
                                            Title="S" 
                                            Anchor="100% 100%"
                                            Layout="FitLayout"
                                            Icon="User"
                                            Hidden="true"
                                            >
                                            <BottomBar>
                                                <ext:Toolbar ID="ToolbarSearchE" runat="server">
                                                    <Items>
                                                        <ext:Button ID="ButtonESearch" runat="server" Text="Search Es" Icon="Find"/>
                                                    </Items>
                                                </ext:Toolbar>
                                            </BottomBar>
                                            <Items>
                                                <ext:TextField ID="TextField1" runat="server" FieldLabel="11" MaxLength="20"/>
                                                <ext:TextField ID="TextField2" runat="server" FieldLabel="22" MaxLength="30"/>
                                                <ext:TextField ID="TextField3" runat="server" FieldLabel="33" MaxLength="30"/>
                                                <ext:TextField ID="TextField4" runat="server" FieldLabel="44" MaxLength="10"/>
                                                <ext:ComboBox ID="ComboBox1" 
                                                    runat="server"
                                                    FieldLabel="55" 
                                                    Editable="true"
                                                    DisplayField="description"
                                                    ValueField="id"
                                                    TypeAhead="true" 
                                                    AllowBlank = "true"
                                                    Mode="Local"
                                                    ForceSelection="true"
                                                    TriggerAction="All"
                                                    EmptyText="Select a ..."
                                                    SelectOnFocus="true">
                                                </ext:ComboBox>
                                                <ext:ComboBox ID="ComboBox2" 
                                                    runat="server"
                                                    FieldLabel="66" 
                                                    Editable="true"
                                                    DisplayField="description"
                                                    ValueField="id"
                                                    TypeAhead="true" 
                                                    Mode="Local"
                                                    ForceSelection="true"
                                                    TriggerAction="All"
                                                    EmptyText="Select a 66..."
                                                    SelectOnFocus="true">
                                                </ext:ComboBox>
                                            </Items>
                                            <KeyMap >
                                                <ext:KeyBinding>             
                                                    <Keys>
                                                        <ext:Key Code="ENTER" />             
                                                    </Keys>
                                                    <Listeners>
                                                        <Event Handler="Ext.getCmp('ButtonESearch').fireEvent('click')" />
                                                    </Listeners>
                                                </ext:KeyBinding>     
                                             </KeyMap>
                                        </ext:FormPanel>
                                        <ext:GridPanel 
                                            ID="GridPanelEsAssigned" 
                                            runat="server" 
                                            Title="Es" 
                                            Layout="FitLayout"
                                            StoreID="Store1"
                                            Anchor="100% 100%"
                                            AutoWidth="true"
                                            AutoRender="false">
                                            <Listeners>
                                                <Activate Single="true"  Fn="renderEsAssigned" />
                                            </Listeners>
                                            
                                            <ColumnModel ID="ColumnModelTd" runat="server">
                                                <Columns>
                                                    <ext:Column ColumnID="No." Editable="false" Width="35" DataIndex = "id" Header="id" />
                                                    <ext:Column ColumnID="t1" Header="t1" Width="70" DataIndex="Price" >
                                                    </ext:Column>
                                                    <ext:Column ColumnID="t2" Header="t2" Width="70" DataIndex="Price">
                                                    </ext:Column>
                                                </Columns>
                                            </ColumnModel>
                                            <SelectionModel >
                                                    <ext:RowSelectionModel ID="RowSelectionModelAssignedEs" runat="server" />
                                                </SelectionModel>
                                            <BottomBar>
                                                <ext:PagingToolbar ID="PagingToolbarE" 
                                                    runat="server" 
                                                    PageSize="50"
                                                    DisplayInfo="true" 
                                                    DisplayMsg="Displaying results {0} - {1} of {2}" 
                                                    EmptyMsg="No results to display">   
                                                    <Items>
                                                        <ext:Button ID="ButtonAddE" runat="server" Text="Add E" Icon="Add">
                                                            <ToolTips>
                                                                <ext:ToolTip ID="ToolTipAddEButton" runat="server" Title="Add E" Html="Click." />
                                                            </ToolTips>
                                                            <Listeners>
                                                                <Click Handler="FormPanelS.setVisible(true);GridPanelEsAssigned.setVisible(false);"/>
                                                            </Listeners>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:PagingToolbar>              
                                            </BottomBar>
                                            <LoadMask ShowMask="true" />
                                        </ext:GridPanel>
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:TabPanel>
                    </South>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    </form>
    </body>
    </html>
    Last edited by Daniil; Aug 28, 2013 at 3:39 AM. Reason: [CLOSED]
  2. #2
    Hi @Z,

    A FitLayout expects the only item.

    You might need to use a CardLayout instead.
    https://examples1.ext.net/#/Layout/CardLayout/Basic/
  3. #3
    ok. I used the CardLayout. That helped with PROBLEM #1. Now it loads properly. However, it did not solve PROBLEM #2.

    In the new example,

    1. click the icon to load the south panel. note it loads fine now.
    2. Click the "Add E" button - note the button bar is not on the bottom as expected
    3. Click "Search Es" button - note the grid shows 1 row. I expect it to have buttons at bottom and scrollbar as needed.

    Thanks,
    /Z

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaticTest.aspx.cs" Inherits="Crystal.Views.Support.StaticTest" %>
    <%@ Import Namespace="Crystal" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ 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></title>
        <style type="text/css">
            .red-text {
                color     : red;
                font-size : large;
            }
            
            .blue-text {
                color     : blue;
                font-size : large;
            }
        </style>
        <script type="text/javascript">
            var renderEsAssigned = function (node) {
                var grid = Ext.getCmp("GridPanelEsAssigned");
                grid.render();
                grid.store.load();
            };
     
            var showDetailPanel = function (node, store, isNew) {
                if (node == null) {
                    //noop
                } else {
                    var nodeId = node.id;
                    var nodeText = node.text;
                    if (nodeId != null) {
                        store.load({
                            callback: function (a, b, c) {
                                //expand the panel
                                Ext.getCmp("TabPanelADetails").setHeight(400);
                                Ext.getCmp("TabPanelADetails").expand();
                                Ext.getCmp("ViewportModel").doLayout();
                            }
                        });
                    }
                }
            };
     
    
        </script>
    
    <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = new List<Company> 
             { 
                 new Company(1, "3m Co", 71.72, 0.02, 0.03, true),
                 new Company(2, "Alcoa Inc", 29.01, 0.42, 1.47, true),
                 new Company(3, "Altria Group Inc", 83.81, 0.28, 0.34, true),
                 new Company(4, "American Express Company", 52.55, 0.01, 0.02, true),
                 new Company(5, "American International Group, Inc.", 64.13, 0.31, 0.49, true),
                 new Company(6, "AT&T Inc.", 31.61, -0.48, -1.54, true),
                 new Company(7, "Boeing Co.", 75.43, 0.53, 0.71, true),
                 new Company(8, "Caterpillar Inc.", 67.27, 0.92, 1.39, true),
                 new Company(9, "Citigroup, Inc.", 49.37, 0.02, 0.04, true),
                 new Company(10, "E.I. du Pont de Nemours and Company", 40.48, 0.51, 1.28, true),
                 new Company(11, "Exxon Mobil Corp", 68.1, -0.43, -0.64, true),
                 new Company(12, "General Electric Company", 34.14, -0.08, -0.23, true),
                 new Company(13, "General Motors Corporation", 30.27, 1.09, 3.74, true),
                 new Company(14, "Hewlett-Packard Co.", 36.53, -0.03, -0.08, true),
                 new Company(15, "Honeywell Intl Inc", 38.77, 0.05, 0.13, true),
                 new Company(16, "Wal-Mart Stores, Inc.", 45.45, 0.73, 1.63, true)
             };
            this.Store1.DataBind();
        }
        public class Company
        {
            public Company(long id, string name, double price, double change, double pctChange, bool checkedVal)
            {
                this.id = id;
                this.Name = name;
                this.Price = price;
                this.Change = change;
                this.PctChange = pctChange;
                this.checkedVal = checkedVal;
            }
            public long id { get; set; }
            public string Name { get; set; }
            public double Price { get; set; }
            public double Change { get; set; }
            public double PctChange { get; set; }
            public bool checkedVal { get; set; }
        }
    </script>
    
    </head>
    <body>
    <form id="AddNodeForm" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server"/>
        <ext:Store ID="Store1" runat="server">
            <Reader>
                <ext:JsonReader IDProperty="id">
                    <Fields>
                        <ext:RecordField Name="id" />
                        <ext:RecordField Name="Name" />
                        <ext:RecordField Name="Price" />
                        <ext:RecordField Name="Change" />
                        <ext:RecordField Name="PctChange" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Viewport ID="ViewportModel" runat="server" Layout="FitLayout">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server" >
                    <Center>
                        <ext:Panel runat="server"
                                ID="CenterPanel"
                                Layout="FitLayout"
                                Anchor="100% 100%"
                                AutoWidth="true"> 
                            <Items>
                                <ext:TreePanel 
                                    ID="TreePanelAs" 
                                    runat="server" 
                                    Title="A" 
                                    RootVisible="true"
                                    Layout="FitLayout"
                                    Anchor="100% 100%"
                                    Width="600"
                                    Icon="Neighbourhood"
                                    Border="false"
                                    AutoScroll="true"
                                    UseArrows="true"
                                    EnableDD="false">     
                                
                                    <Sorter FolderSort="true" />
                                    <Root>
                                        <ext:AsyncTreeNode AutoDataBind="true" Icon="UserHome " AllowDrag="false" Draggable = "false" NodeID="1" Text="1"  />
                                    </Root>
                                    <Listeners>
                                        <Click Handler="showDetailPanel(node, #{Store1}, 'N');" />
                                    </Listeners>
                                </ext:TreePanel>
                            </Items>
                        </ext:Panel>
                    </Center>
                    <South Split="true">
                        <ext:TabPanel 
                            ID="TabPanelADetails" 
                            runat="server" 
                            Height="500"
                            Collapsible="true" 
                            Title="Detail Panel"
                            AnimCollapse="false"
                            Collapsed="true"
                            CollapseMode="Default"
                            ActiveTabIndex="0">
                            <Listeners>
                                <Expand Handler="#{TreePanelAs}.disable();"/>
                                <Collapse Handler="#{TreePanelAs}.enable();"/>
                            </Listeners>
                            <Items>
                                <ext:FormPanel 
                                    ID="FormPanel1" 
                                    runat="server" 
                                    Title="S" 
                                            
                                    Icon="User"
                                    Hidden="true"
                                    >
                                    <BottomBar>
                                        <ext:Toolbar ID="Toolbar1" runat="server">
                                            <Items>
                                                <ext:Button ID="Button1" runat="server" Text="Search Es" Icon="Find"/>
                                            </Items>
                                        </ext:Toolbar>
                                    </BottomBar>
                                    <Items>
                                        <ext:TextField ID="TextField5" runat="server" FieldLabel="11" MaxLength="20"/>
                                        <ext:TextField ID="TextField6" runat="server" FieldLabel="22" MaxLength="30"/>
                                        <ext:TextField ID="TextField7" runat="server" FieldLabel="33" MaxLength="30"/>
                                        <ext:TextField ID="TextField8" runat="server" FieldLabel="44" MaxLength="10"/>
                                        <ext:ComboBox ID="ComboBox3" 
                                            runat="server"
                                            FieldLabel="55" 
                                            Editable="true"
                                            DisplayField="description"
                                            ValueField="id"
                                            TypeAhead="true" 
                                            AllowBlank = "true"
                                            Mode="Local"
                                            ForceSelection="true"
                                            TriggerAction="All"
                                            EmptyText="Select a ..."
                                            SelectOnFocus="true">
                                        </ext:ComboBox>
                                        <ext:ComboBox ID="ComboBox4" 
                                            runat="server"
                                            FieldLabel="66" 
                                            Editable="true"
                                            DisplayField="description"
                                            ValueField="id"
                                            TypeAhead="true" 
                                            Mode="Local"
                                            ForceSelection="true"
                                            TriggerAction="All"
                                            EmptyText="Select a 66..."
                                            SelectOnFocus="true">
                                        </ext:ComboBox>
                                    </Items>
                                    <KeyMap >
                                        <ext:KeyBinding>             
                                            <Keys>
                                                <ext:Key Code="ENTER" />             
                                            </Keys>
                                            <Listeners>
                                                <Event Handler="Ext.getCmp('ButtonESearch').fireEvent('click')" />
                                            </Listeners>
                                        </ext:KeyBinding>     
                                        </KeyMap>
                                </ext:FormPanel>
                                <ext:Panel  Layout="CardLayout" runat="server" AutoWidth="true" ActiveIndex="2" ID="EPanel" Border="False" Title="Es">
                                    <Listeners>
                                        <Activate Single="true"  Fn="renderEsAssigned" />
                                    </Listeners>
                                    <Items>
                                        <ext:FormPanel 
                                            ID="FormPanelS" 
                                            runat="server" 
                                            Title="S" 
                                            Icon="User"
                                            Hidden="true"
                                            >
                                            <BottomBar>
                                                <ext:Toolbar ID="ToolbarSearchE" runat="server">
                                                    <Items>
                                                        <ext:Button ID="ButtonESearch" runat="server" Text="Search Es" Icon="Find">
                                                            <Listeners>
                                                                <Click Handler="FormPanelS.setVisible(false);GridPanel1.setVisible(true);"/>
                                                            </Listeners>
                                                        </ext:Button>
                                                </Items>
                                                </ext:Toolbar>
                                            </BottomBar>
                                            <Items>
                                                <ext:TextField ID="TextField1" runat="server" FieldLabel="11" MaxLength="20"/>
                                                <ext:TextField ID="TextField2" runat="server" FieldLabel="22" MaxLength="30"/>
                                                <ext:TextField ID="TextField3" runat="server" FieldLabel="33" MaxLength="30"/>
                                                <ext:TextField ID="TextField4" runat="server" FieldLabel="44" MaxLength="10"/>
                                                <ext:ComboBox ID="ComboBox1" 
                                                    runat="server"
                                                    FieldLabel="55" 
                                                    Editable="true"
                                                    DisplayField="description"
                                                    ValueField="id"
                                                    TypeAhead="true" 
                                                    AllowBlank = "true"
                                                    Mode="Local"
                                                    ForceSelection="true"
                                                    TriggerAction="All"
                                                    EmptyText="Select a ..."
                                                    SelectOnFocus="true">
                                                </ext:ComboBox>
                                                <ext:ComboBox ID="ComboBox2" 
                                                    runat="server"
                                                    FieldLabel="66" 
                                                    Editable="true"
                                                    DisplayField="description"
                                                    ValueField="id"
                                                    TypeAhead="true" 
                                                    Mode="Local"
                                                    ForceSelection="true"
                                                    TriggerAction="All"
                                                    EmptyText="Select a 66..."
                                                    SelectOnFocus="true">
                                                </ext:ComboBox>
                                            </Items>
                                            <KeyMap >
                                                <ext:KeyBinding>             
                                                    <Keys>
                                                        <ext:Key Code="ENTER" />             
                                                    </Keys>
                                                    <Listeners>
                                                        <Event Handler="Ext.getCmp('ButtonESearch').fireEvent('click')" />
                                                    </Listeners>
                                                </ext:KeyBinding>     
                                             </KeyMap>
                                        </ext:FormPanel>
                                        <ext:GridPanel 
                                            ID="GridPanel1" 
                                            runat="server" 
                                            Title="Es" 
                                            Layout="FitLayout"
                                            StoreID="Store1"
                                            Anchor="100% 100%"
                                            AutoWidth="true"
                                            AutoRender="false">
                                            <Listeners>
                                                <Activate Single="true"  Fn="renderEsAssigned" />
                                            </Listeners>
                                            
                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                <Columns>
                                                    <ext:Column ColumnID="No." Editable="false" Width="35" DataIndex = "id" Header="id" />
                                                    <ext:Column ColumnID="t1" Header="t1" Width="70" DataIndex="Price" >
                                                    </ext:Column>
                                                    <ext:Column ColumnID="t2" Header="t2" Width="70" DataIndex="Price">
                                                    </ext:Column>
                                                </Columns>
                                            </ColumnModel>
                                            <SelectionModel >
                                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                                                </SelectionModel>
                                            <BottomBar>
                                                <ext:PagingToolbar ID="PagingToolbar1" 
                                                    runat="server" 
                                                    PageSize="50"
                                                    DisplayInfo="true" 
                                                    DisplayMsg="Displaying results {0} - {1} of {2}" 
                                                    EmptyMsg="No results to display">   
                                                    <Items>
                                                        <ext:Button ID="Button2" runat="server" Text="Add E" Icon="Add">
                                                            <ToolTips>
                                                                <ext:ToolTip ID="ToolTip1" runat="server" Title="Add E" Html="Click." />
                                                            </ToolTips>
                                                            <Listeners>
                                                                <Click Handler="FormPanelS.setVisible(true);GridPanelEsAssigned.setVisible(false);"/>
                                                            </Listeners>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:PagingToolbar>              
                                            </BottomBar>
                                            <LoadMask ShowMask="true" />
                                        </ext:GridPanel>
                                        <ext:GridPanel 
                                            ID="GridPanelEsAssigned" 
                                            runat="server" 
                                            Title="Es" 
                                            Layout="FitLayout"
                                            StoreID="Store1"
                                            Anchor="100% 100%"
                                            AutoWidth="true"
                                            AutoRender="false">
                                            <Listeners>
                                                <Activate Single="true"  Fn="renderEsAssigned" />
                                            </Listeners>
                                            
                                            <ColumnModel ID="ColumnModelTd" runat="server">
                                                <Columns>
                                                    <ext:Column ColumnID="No." Editable="false" Width="35" DataIndex = "id" Header="id" />
                                                    <ext:Column ColumnID="t1" Header="t1" Width="70" DataIndex="Price" >
                                                    </ext:Column>
                                                    <ext:Column ColumnID="t2" Header="t2" Width="70" DataIndex="Price">
                                                    </ext:Column>
                                                </Columns>
                                            </ColumnModel>
                                            <SelectionModel >
                                                    <ext:RowSelectionModel ID="RowSelectionModelAssignedEs" runat="server" />
                                                </SelectionModel>
                                            <BottomBar>
                                                <ext:PagingToolbar ID="PagingToolbarE" 
                                                    runat="server" 
                                                    PageSize="50"
                                                    DisplayInfo="true" 
                                                    DisplayMsg="Displaying results {0} - {1} of {2}" 
                                                    EmptyMsg="No results to display">   
                                                    <Items>
                                                        <ext:Button ID="ButtonAddE" runat="server" Text="Add E" Icon="Add">
                                                            <ToolTips>
                                                                <ext:ToolTip ID="ToolTipAddEButton" runat="server" Title="Add E" Html="Click." />
                                                            </ToolTips>
                                                            <Listeners>
                                                                <Click Handler="FormPanelS.setVisible(true);GridPanelEsAssigned.setVisible(false);"/>
                                                            </Listeners>
                                                        </ext:Button>
                                                    </Items>
                                                </ext:PagingToolbar>              
                                            </BottomBar>
                                            <LoadMask ShowMask="true" />
                                        </ext:GridPanel>
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:TabPanel>
                    </South>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    </form>
    </body>
    </html>
  4. #4
    Hidden="true"
    and
    component.render();
    are not the way that you should manage cards (items of CardLayout).

    Please use a CardLayout's setActiveItem method.

    Example
    <%@ 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 runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel runat="server" Region="West" Width="100">
                        <Items>
                            <ext:Button runat="server" Text="Switch">
                                <Listeners>
                                    <Click Handler="Panel1.layout.setActiveItem(1);" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Panel>
                    <ext:Panel 
                        ID="Panel1" 
                        runat="server" 
                        Region="Center" 
                        Layout="CardLayout" 
                        ActiveIndex="0">
                        <Items>
                            <ext:Panel runat="server" BodyStyle="background-color: green;" />
                            <ext:Panel runat="server" BodyStyle="background-color: yellow;" />
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
  5. #5
    thanks for pointing that out. I still had the old FitLayout code in there. I changed it to use activeIndex and it works perfectly now.
    /Z

Similar Threads

  1. [CLOSED] Application is not working properly in IE10
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 24, 2013, 9:11 AM
  2. Replies: 0
    Last Post: Mar 19, 2013, 12:51 PM
  3. ForPanelFor Column Layout not working in IE
    By millenovanta in forum 2.x Help
    Replies: 2
    Last Post: Jan 06, 2013, 6:37 PM
  4. Replies: 5
    Last Post: Feb 23, 2012, 8:00 AM
  5. [CLOSED] HtmlEditor - EnableFont not working properly
    By alexp in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 24, 2009, 11:42 AM

Posting Permissions