source: trunk/web/addons/job_monarch/lib/extjs/docs/output/Ext.layout.FormLayout.html @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 10.2 KB
Line 
1        <div class="body-wrap">
2        <div class="top-tools">
3            <a class="inner-link" href="#Ext.layout.FormLayout-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4            <a class="inner-link" href="#Ext.layout.FormLayout-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5            <a class="inner-link" href="#Ext.layout.FormLayout-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                            <a class="inner-link" href="#Ext.layout.FormLayout-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7                        <a class="bookmark" href="../docs/?class=Ext.layout.FormLayout"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8        </div>
9                <div class="inheritance res-block">
10<pre class="res-block-inner"><a ext:cls="Ext.layout.ContainerLayout" ext:member="" href="output/Ext.layout.ContainerLayout.html">ContainerLayout</a>
11  <img src="resources/elbow-end.gif"/><a ext:cls="Ext.layout.AnchorLayout" ext:member="" href="output/Ext.layout.AnchorLayout.html">AnchorLayout</a>
12    <img src="resources/elbow-end.gif"/>FormLayout</pre></div>
13                <h1>Class Ext.layout.FormLayout</h1>
14        <table cellspacing="0">
15            <tr><td class="label">Package:</td><td class="hd-info">Ext.layout</td></tr>
16            <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/FormLayout.js" target="_blank">FormLayout.js</a></td></tr>
17            <tr><td class="label">Class:</td><td class="hd-info">FormLayout</td></tr>
18                                    <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.layout.AnchorLayout" ext:member="" href="output/Ext.layout.AnchorLayout.html">AnchorLayout</a></td></tr>
19                    </table>
20        <div class="description">
21            *
22<p>This layout manager is specifically designed for rendering and managing child Components of forms.
23It is responsible for rendering the labels of <a ext:cls="Ext.form.Field" href="output/Ext.form.Field.html">Field</a>s.</p>
24<p>This layout manager is used when a Container is configured with the layout:'form' <a ext:cls="Ext.Container" ext:member="layout" href="output/Ext.Container.html#layout">layout</a> config,
25and should generally not need to be created directly via the new keyword. In an application,
26it will usually be preferrable to use a <a ext:cls="Ext.form.FormPanel" href="output/Ext.form.FormPanel.html">FormPanel</a> (which automatically uses FormLayout as its layout
27class) since it also provides built-in functionality for loading, validating and submitting the form.</p>
28<p>Note that when creating a layout via config, the layout-specific config properties must be passed in via
29the <a ext:cls="Ext.Container" ext:member="layoutConfig" href="output/Ext.Container.html#layoutConfig">layoutConfig</a> object which will then be applied internally to the layout.</p>
30<p>The <a ext:cls="Ext.Container" href="output/Ext.Container.html">Container</a> <i>using</i> the FormLayout can also accept the following layout-specific config
31properties:
32<div class="mdetail-params"><ul>
33<li><b>hideLabels</b>: (Boolean)<div class="sub-desc">True to hide field labels by default (defaults to false)</div></li>
34<li><b>labelAlign</b>: (String)<div class="sub-desc">The default label alignment.  The default value is empty string ''
35for left alignment, but specifying 'top' will align the labels above the fields.</div></li>
36<li><b>labelPad</b>: (Number)<div class="sub-desc">The default padding in pixels for field labels (defaults to 5).  labelPad only
37applies if labelWidth is also specified, otherwise it will be ignored.</div></li>
38<li><b>labelWidth</b>: (Number)<div class="sub-desc">The default width in pixels of field labels (defaults to 100)</div></li>
39</ul></div></p>
40<p>Any type of components can be added to a FormLayout, but items that inherit from <a ext:cls="Ext.form.Field" href="output/Ext.form.Field.html">Ext.form.Field</a>
41can also supply the following field-specific config properties:
42<div class="mdetail-params"><ul>
43<li><b>clearCls</b>: (String)<div class="sub-desc">The CSS class to apply to the special clearing div rendered directly after each
44form field wrapper (defaults to 'x-form-clear-left')</div></li>
45<li><b>fieldLabel</b>: (String)<div class="sub-desc">The text to display as the label for this field (defaults to '')</div></li>
46<li><b>hideLabel</b>: (Boolean)<div class="sub-desc">True to hide the label and separator for this field (defaults to false).</div></li>
47<li><b>itemCls</b>: (String)<div class="sub-desc">A CSS class to add to the div wrapper that contains this field label
48and field element (the default class is 'x-form-item' and itemCls will be added to that).  If supplied,
49itemCls at the field level will override the default itemCls supplied at the container level.</div></li>
50<li><b>labelSeparator</b>: (String)<div class="sub-desc">The separator to display after the text of the label for this field
51(defaults to a colon ':' or the layout's value for <a ext:cls="Ext.layout.FormLayout" ext:member="labelSeparator" href="output/Ext.layout.FormLayout.html#labelSeparator">labelSeparator</a>).  To hide the separator use empty string ''.</div></li>
52<li><b>labelStyle</b>: (String)<div class="sub-desc">A CSS style specification string to add to the field label for this field
53(defaults to '' or the layout's value for <a ext:cls="Ext.layout.FormLayout" ext:member="labelStyle" href="output/Ext.layout.FormLayout.html#labelStyle">labelStyle</a>).</div></li>
54</ul></div></p>
55Example usage:</p>
56<pre><code><i>// Required <b>if</b> showing validation messages</i>
57Ext.QuickTips.init();
58
59<i>// While you can create a basic Panel <b>with</b> layout:<em>'form'</em>, practically</i>
60<i>// you should usually use a FormPanel to also get its form functionality</i>
61<i>// since it already creates a FormLayout internally.</i>
62<b>var</b> form = <b>new</b> Ext.form.FormPanel({
63    labelWidth: 75,
64    title: <em>'Form Layout'</em>,
65    bodyStyle:<em>'padding:15px'</em>,
66    width: 350,
67    labelPad: 10,
68    defaultType: <em>'textfield'</em>,
69    defaults: {
70        <i>// applied to each contained item</i>
71        width: 230,
72        msgTarget: <em>'side'</em>
73    },
74    layoutConfig: {
75        <i>// layout-specific configs go here</i>
76        labelSeparator: <em>''</em>
77    },
78    items: [{
79            fieldLabel: <em>'First Name'</em>,
80            name: <em>'first'</em>,
81            allowBlank: false
82        },{
83            fieldLabel: <em>'Last Name'</em>,
84            name: <em>'last'</em>
85        },{
86            fieldLabel: <em>'Company'</em>,
87            name: <em>'company'</em>
88        },{
89            fieldLabel: <em>'Email'</em>,
90            name: <em>'email'</em>,
91            vtype:<em>'email'</em>
92        }
93    ],
94    buttons: [{
95        text: <em>'Save'</em>
96    },{
97        text: <em>'Cancel'</em>
98    }]
99});</code></pre>        </div>
100       
101        <div class="hr"></div>
102                <a id="Ext.layout.FormLayout-configs"></a>
103        <h2>Config Options</h2>
104        <table cellspacing="0" class="member-table">
105            <tr>
106                <th class="sig-header" colspan="2">Config Options</th>
107                <th class="msource-header">Defined By</th>
108            </tr>
109                <tr class="config-row inherited expandable">
110        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
111        <td class="sig">
112        <a id="Ext.layout.FormLayout-extraCls"></a>
113            <b>extraCls</b> : String            <div class="mdesc">
114                        <div class="short">An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding custo...</div>
115            <div class="long">
116                An optional extra CSS class that will be added to the container (defaults to ''). This can be useful for adding customized styles to the container or any of its children using standard CSS rules.            </div>
117                        </div>
118        </td>
119        <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#extraCls" href="output/Ext.layout.ContainerLayout.html#extraCls">ContainerLayout</a></td>
120    </tr>
121        <tr class="config-row alt expandable">
122        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
123        <td class="sig">
124        <a id="Ext.layout.FormLayout-labelSeparator"></a>
125            <b>labelSeparator</b> : String            <div class="mdesc">
126                        <div class="short">The standard separator to display after the text of each form label (defaults to a colon ':'). To turn off separators...</div>
127            <div class="long">
128                The standard separator to display after the text of each form label (defaults to a colon ':'). To turn off separators for all fields in this layout by default specify empty string '' (if the labelSeparator value is explicitly set at the field level, those will still be displayed).            </div>
129                        </div>
130        </td>
131        <td class="msource">FormLayout</td>
132    </tr>
133        <tr class="config-row inherited">
134        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
135        <td class="sig">
136        <a id="Ext.layout.FormLayout-renderHidden"></a>
137            <b>renderHidden</b> : Boolean            <div class="mdesc">
138                            True to hide each contained item on render (defaults to false).                        </div>
139        </td>
140        <td class="msource"><a ext:cls="Ext.layout.ContainerLayout" ext:member="#renderHidden" href="output/Ext.layout.ContainerLayout.html#renderHidden">ContainerLayout</a></td>
141    </tr>
142            </table>
143                <a id="Ext.layout.FormLayout-props"></a>
144        <h2>Public Properties</h2>
145        <div class="no-members">This class has no public properties.</div>        <a id="Ext.layout.FormLayout-methods"></a>
146        <h2>Public Methods</h2>
147        <div class="no-members">This class has no public methods.</div>        <a id="Ext.layout.FormLayout-events"></a>
148        <h2>Public Events</h2>
149        <div class="no-members">This class has no public events.</div>
150        </div>
Note: See TracBrowser for help on using the repository browser.