[CLOSED] columnlayout troubles

  1. #1

    [CLOSED] columnlayout troubles

    Hello

    I am calling creating a panel with a gridpanel within a tabpanel. The gridpanel should only occupy a third of the parent via columnlayout and columnwidth = 0.33. But somehow it occupies always 100%. Does anybody know where I am making the error in the configuration via directmethod?

    Thank you very much.

    best regards.

    Test case: (click on tab2)
    <%@ Page Language="C#" %>
    
    <script runat="server">
        
        [DirectMethod]
        public void PopulateTab()
        {
            Ext.Net.Panel pnl = X.GetCmp<Ext.Net.Panel>("pTab2");
    
            pnl.Layout = "ColumnLayout";
    
            GridPanel gp1 = new GridPanel
            {
                Title = "Gridpanel 1",
                ColumnWidth = 0.33
            };
            pnl.Items.Add(gp1);
    
            pnl.UpdateContent();
        }
    
        </script>
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Test</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" Locale="de-ch" />
    
        <ext:Tabpanel runat="server">
            <Items>
                <ext:Panel runat="server" Title="Tab1">
                    <Items>
                        <ext:Label runat="server" Text="empty"></ext:Label>
                    </Items>
                </ext:Panel>
                <ext:Panel runat="server" Title="Tab2" ID="pTab2">
                    <Listeners>
                        <BeforeRender Handler="App.direct.PopulateTab()"></BeforeRender>
                    </Listeners>
                </ext:Panel>
            </Items>
        </ext:Tabpanel>
    </body>
    </html>
    Last edited by fabricio.murta; Jul 06, 2015 at 8:54 PM. Reason: [CLOSED]
  2. #2
    Hello @tMp!

    A tabPanel per se does not contain a layout. A tabPanel contain tabs which in turn have a respective layout.

    You can see a tabPanel as the guide for tabs you're adding to it. The panel (or any container), can be thought as actual individual tabs.

    Said that, what you need to do is bind to your second tab a container (which could be a bare container, a panel, or a gridPanel). Inside this outer container (aka tab) you add your desired, layout-bound items.

    In a more practical approach, you create the tabPanel, add a container with ColumnLayout and, then, add your panel inside it.

    Even more practical now, your example reflecting this would be:
    <script runat="server">
        [DirectMethod]
        public void PopulateTab()
        {
            Ext.Net.Panel pnl = X.GetCmp<Ext.Net.Panel>("pTab2");
    
            var tab = new Container();
            tab.Layout = "ColumnLayout";
    
            GridPanel gp1 = new GridPanel
            {
                Title = "Gridpanel 1",
                ColumnWidth = 0.33,
                Frame = true
            };
    
            tab.Items.Add(gp1);
            pnl.Items.Add(tab);
            
            pnl.UpdateContent();
        }
        </script>
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Test</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" Locale="de-ch" />
    
        <ext:Tabpanel runat="server">
            <Items>
                <ext:Panel runat="server" Title="Tab1">
                    <Items>
                        <ext:Label runat="server" Text="empty"></ext:Label>
                    </Items>
                </ext:Panel>
                <ext:Panel runat="server" Title="Tab2" ID="pTab2">
                    <Listeners>
                        <BeforeRender Handler="App.direct.PopulateTab()"></BeforeRender>
                    </Listeners>
                </ext:Panel>
            </Items>
        </ext:Tabpanel>
    </body>
    </html>
    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    oh, yes! It does a lot! Working like a charme, thank you very much.

    best regards.

Similar Threads

  1. [CLOSED] Troubles with some Textfield
    By timiteh in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 27, 2013, 9:07 AM
  2. Replies: 6
    Last Post: Jun 28, 2013, 6:58 AM
  3. Troubles with Javascript during rendering
    By Paul D in forum 1.x Help
    Replies: 2
    Last Post: Nov 08, 2010, 11:15 AM
  4. [CLOSED] Help with some troubles
    By smart+ in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 09, 2010, 3:36 PM
  5. [CLOSED] [0.8.2] Notifications and js troubles.
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 20, 2010, 4:51 AM

Posting Permissions