[1.0] layouts attribute

  1. #1

    [1.0] layouts attribute

    panels now include a "Layout" attribute wherein you can set the layout there instead of having to add a layout control on the items collection... i've seen example of layout="fit" and layout="anchor", but how about layout="column"? what layouts can i just add an attribute on the panel and what layouts must i add layouts controls to the items collection of the panel... because this throws an error


    
    <ext:Window ID="extwinCompanyInfo" runat="server" Height="450" Width="680" ConstrainHeader="false"
        Hidden="true" BodyStyle="background-color:white; padding: 5px 5px 5px 5px;" Title="Company Information" Modal="true" Resizable="false" AutoRender="false" Layout="Column" >
        <Content>
                    <ext:LayoutColumn ColumnWidth="0.5">
                        <ext:FieldSet ID="FieldSet1" runat="server" LabelWidth="150"
                            BodyStyle="padding: 5px 0 0 5px;" StyleSpec="border:none">
                            <Content>
  2. #2

    RE: [1.0] layouts attribute

    The .Layout property is only used when inner Components are configured to use the new <Items> inner property.

    If .Layout is specified, then the Layout control is not required. Adding a Layout control inside <Items> or <Content> is still supported, although using .Layout does simplify the syntax and theoretically would produce a minor performance enhancement.

    You can specify the full Layout control name for the .Layout property, or a shortened alias. For example, the following values are all acceptable if you wish to configure a FitLayout.

    Example

    Layout="FitLayout|fitlayout|Fit|fit"
    Basically you only need to set .Layout with the name of the layout you wish to use, and can omit the "Layout" portion of the string, such as "FitLayout" or just "Fit" or lowercase "fit".

    Your sample would be re-configured as follows.

    Example

    <ext:Window 
        ID="extwinCompanyInfo" 
        runat="server" 
        Height="450" 
        Width="680" 
        ConstrainHeader="false"
        Hidden="true" 
        BodyStyle="background-color:white; padding: 5px 5px 5px 5px;" 
        Title="Company Information" 
        Modal="true" 
        Resizable="false" 
        AutoRender="false" 
        Layout="Column">
        <Items>
            <ext:FieldSet 
                ID="FieldSet1" 
                runat="server" 
                LabelWidth="150"
                ColumnWidth="0.5"
                BodyStyle="padding: 5px 0 0 5px;" 
                StyleSpec="border:none">
                <Content>
    Please note that you do not require the inner <ext:LayoutColumn> control as the values are now also available on the Container (FieldSet).

    As well, using the new .Layout property is not required for upgrading to v1.0. You can still use the <Content> (formally <Body> ) inner property and configure your layouts as always. Although, if you do configure an inner Layout control, I would recommend upgrading to the new <Items> inner property instead of <Content>. Internally the two are handled differently and the <Items> collection is more efficient than <Content>.

    Using <Content> does allow for adding non-Toolkit controls, html or raw text inside, whereas <Items> only allows for Toolkit components to be added.

    Hope this helps.

    Geoffrey McGill
    Founder
  3. #3

    RE: [1.0] layouts attribute

    ok, that's great, thanks for the examples... a lot of new stuffs in place,, seems like learning coolite all over again :D

Similar Threads

  1. [CLOSED] Column Layouts from codebehind
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 12, 2012, 10:43 PM
  2. [CLOSED] Question about layouts
    By jcanton in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jul 21, 2009, 10:55 AM
  3. Master pages and layouts
    By davidhoyt in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 31, 2008, 7:14 AM
  4. Save and restore between layouts
    By giannik in forum Open Discussions
    Replies: 3
    Last Post: Apr 24, 2008, 3:05 PM
  5. Layouts, tabs etc...
    By jonah in forum Open Discussions
    Replies: 5
    Last Post: Apr 09, 2008, 11:38 AM

Posting Permissions