[CLOSED] User Control width within ColumnLayout

  1. #1

    [CLOSED] User Control width within ColumnLayout

    Hi

    I've got a problem getting a User Control (Coolite-based Panels) to auto size when placed on a Page using a ColumnLayout.

    On the main page (using the Control) I've got:

    <ext:Panel ID="mainPanel" runat="server">
        <Body>
            <ext:ColumnLayout runat="server">
                <ext:LayoutColumn ColumnWidth="0.5">
                    <ext:Panel ID="contactAddress" runat="server">
                        <Body>
                            <uc1:AddressRecords ID="contactAddressUC" runat="server" />
                        </Body>
                    </ext:Panel>  
                </ext:LayoutColumn>
                <ext:LayoutColumn ColumnWidth="0.5">
                    <ext:Panel ID="companyAddress" runat="server">
                        <Body>
                            <uc1:AddressRecords ID="companyAddressUC" runat="server" />
                        </Body>
                    </ext:Panel>                        
                </ext:LayoutColumn>
            </ext:ColumnLayout>
        </Body>
    </ext:Panel>
    In the User Control I've got :

    <ext:Panel ID="addressPanel" runat="server" Border="false" MonitorResize="true" AutoWidth="true">
        <Body>
            <ext:FieldSet ID="addressFieldSet" Title="Locations" runat="server">            
                <Body>
                    <ext:FormPanel ID="addressFormPanel" runat="server" Border="false">
                        <Body>            
                            <ext:FormLayout ID="addressForm" runat="server">
                            <ext:Anchor Horizontal="95%">
                            <ext:ComboBox 
                                ID="addressTitleCombo" 
                                runat="server" 
                                SourceID="addressStore"
                                FieldLabel="Address Title"
                                DisplayField="addressTitle"
                                ValueField="id"
                                TriggerAction="All" 
                                Editable="true" 
                                Mode="Local" 
                                BlankText="Select an address">
                                <Listeners>
                                    <Select Handler="#{addressFormPanel}.getForm().loadRecord(record);" />
                                </Listeners>
                            </ext:ComboBox>
                        </ext:Anchor>
    ... Additional Fields .....
                    </ext:FormLayout>
                        </Body>
                    </ext:FormPanel>
                </Body>
            </ext:FieldSet>
        </Body>
    </ext:Panel>
    I can't get the User Control to fit the width of the ColumnLayout. I've tried FitLayout in both (page and control page), but they wouldn't resize to the column width, and instead extend off to the right hand side (obviously half hidden)

    I'm sure it's a simple matter of getting the panel (and panel type) in the right order, but I can't figure it out.

    Cheers

    Steve
  2. #2

    RE: [CLOSED] User Control width within ColumnLayout

    Hi,

    What if remove the top panel from user control and FitLayout?
    <%@ Control Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <ext:FitLayout runat="server">
        <ext:FieldSet ID="addressFieldSet" Title="Locations" runat="server">
            <Body>
                <ext:FormPanel ID="addressFormPanel" runat="server" Border="false">
                    <Body>
                        <ext:FormLayout ID="addressForm" runat="server">
                            <ext:Anchor Horizontal="95%">
                                <ext:ComboBox ID="addressTitleCombo" runat="server" 
                                    FieldLabel="Address Title"
                                    TriggerAction="All" 
                                    Editable="true"
                                    Mode="Local" 
                                    BlankText="Select an address">
                                    <Listeners>
                                        <Select Handler="#{addressFormPanel}.getForm().loadRecord(record);" />
                                    </Listeners>
                                </ext:ComboBox>
                            </ext:Anchor>
                        </ext:FormLayout>
                    </Body>
                </ext:FormPanel>
            </Body>
        </ext:FieldSet>
    </ext:FitLayout>
  3. #3

    RE: [CLOSED] User Control width within ColumnLayout

    You know, I really should have known that. I've got too used to the Ext Panel nesting tricks :)

    Thanks again Vladimir, another quick solution!


    Cheers


    Steve

Similar Threads

  1. Replies: 7
    Last Post: Jan 29, 2013, 11:59 AM
  2. Replies: 2
    Last Post: Feb 06, 2012, 9:06 AM
  3. [CLOSED] ColumnLayout - not setting width before content
    By craig2005 in forum 1.x Legacy Premium Help
    Replies: 50
    Last Post: Feb 07, 2011, 4:56 PM
  4. how to upload user control dynamicaly on user control
    By archana mahadule in forum 1.x Help
    Replies: 1
    Last Post: Jan 13, 2011, 12:05 PM
  5. Replies: 2
    Last Post: Aug 27, 2009, 8:12 AM

Posting Permissions