[CLOSED] Auto Width Panel inside TabPanel

  1. #1

    [CLOSED] Auto Width Panel inside TabPanel

    Hi,
    I don't succeed in making an auto width panel inside tabpanel, in my example the panel pnlTest takes the width on the parent and I want that takes the width of the child label.
    Please help me.

    Thank you very much

    Jimmy

    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <!DOCTYPE html>
    
    
    <html>
      <head id="Head1" runat="server">
        <title></title>
      </head>
      <body>
        <form id="Form1" runat="server">
          <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:TabPanel ID="TabPanel1" runat="server" Height="500">
              <Items>
                <ext:Panel ID="Panel1" 
                  runat="server" 
                  Title="Tab"
                >
                  <Items>
                    <ext:Panel ID="pnlTest" runat="server" Title="test" X="20" Y="30" >
                      <Items>
                        <ext:Label ID="lbl" runat="server" Text="test" ></ext:Label>
                      </Items>
                    </ext:Panel>
                  </Items>
               </ext:Panel>
             </Items>
           </ext:TabPanel>       
        </form>
      </body>
    </html>
    Last edited by Daniil; Oct 08, 2012 at 5:03 PM. Reason: [CLOSED]
  2. #2
    Hi @xeo4.it,

    Maybe something like this.
    <ext:Panel runat="server">
        <Items>
            <ext:Label runat="server" Text="test">
                <Listeners>
                    <AfterRender Handler="this.up('panel').setWidth(this.getWidth());" />
                </Listeners>
            </ext:Label>
        </Items>
    </ext:Panel>
  3. #3
    Hi Danil,
    the problem is that the panel not auto size, in the ext.net 1.x the panel size suited him for its content, without I did nothing.

    Jimmy
  4. #4
    Hi Jimmy,

    I tried your sample in v1 - the Panel stretches up to the screen width the same way as it is in v2.

    Could you provide a sample for v1?
  5. #5
    Hi Daniil,
    I have made the example in v1:

    <%@ 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></title>
    </head>
    <body>
        <form id="form1" runat="server">
          <ext:ResourceManager ID="ScriptManager1" runat="server" >
          </ext:ResourceManager>
    
    
          <ext:TabPanel ID="tabPnl" Plain="true" TabPosition="Top" runat="server" Border="false" Height="500">
            <Items>
              <ext:Panel ID="test" runat="server" Border="false" Title="Tab 1" Closable="true" X="0" Y="0" >
                <Items>
                  <ext:Panel ID="pnlTest" runat="server" Border="true" Title="test" BoxMinHeight="0" Frame="true" X="50" Y="30" Floating="true" >
                    <Items>
                      <ext:TableLayout ID="tbl" runat="server" Columnbs="1">
                        <Cells>
                          <ext:Cell>
                            <ext:Label ID="lblTest" runat="server" Text="Test one"></ext:Label>
                          </ext:Cell>
                        </Cells>
                      </ext:TableLayout>
                    </Items>
                  </ext:Panel>
                </Items>
              </ext:Panel>
            </Items>
          </ext:TabPanel>
        </form>
    </body>
    </html>
    The difference is that the panel "pnlTest" has Floating property set to true, but if I set the property floating to true in v2 the panel doesn't show.
    Please help me.

    Thank you very much.
  6. #6
    Thank you for the sample.

    Well, it looks a hack and I was surprised that it works as you need.

    Please use the solution from the post #2. It should work well and be stable.
  7. #7
    Hi Daniil,
    ok, I will use the solution of post #2.

    Thank you

    Jimmy

Similar Threads

  1. Replies: 1
    Last Post: Oct 26, 2011, 7:17 AM
  2. [CLOSED] TextField 100% Width inside a Panel in a FormPanel
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 11, 2011, 10:43 AM
  3. [CLOSED] Grid Panel : Column width (Auto width)
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 24, 2011, 8:31 PM
  4. Replies: 7
    Last Post: Feb 01, 2011, 11:00 AM
  5. Window Panel auto width
    By tas in forum 1.x Help
    Replies: 2
    Last Post: Nov 19, 2008, 5:31 AM

Posting Permissions