3 'Ext.layout.container.Column',
10 * Copyright(c) 2006-2010 Sencha Inc.
11 * licensing@sencha.com
12 * http://www.sencha.com/license
14 Ext.onReady(function(){
18 var bd = Ext.getBody();
21 * ================ Simple form =======================
23 bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'});
26 var simple = Ext.create('Ext.form.Panel', {
30 bodyStyle:'padding:5px 5px 0',
36 defaultType: 'textfield',
42 fieldLabel: 'First Name',
46 fieldLabel: 'Last Name',
49 fieldLabel: 'Company',
70 simple.render(document.body);
74 * ================ Form 2 =======================
76 bd.createChild({tag: 'h2', html: 'Form 2 - Adding fieldsets'});
78 var fsf = Ext.create('Ext.form.Panel', {
81 title: 'Simple Form with FieldSets',
82 bodyStyle:'padding:5px 5px 0',
95 title: 'User Information',
96 defaultType: 'textfield',
103 fieldLabel: 'First Name',
107 fieldLabel: 'Last Name',
110 fieldLabel: 'Company',
119 title: 'Phone Number',
121 defaultType: 'textfield',
129 value: '(888) 555-1212'
131 fieldLabel: 'Business',
134 fieldLabel: 'Mobile',
149 fsf.render(document.body);
152 * ================ Form 3 =======================
154 bd.createChild({tag: 'h2', html: 'Form 3 - A little more complex'});
157 var top = Ext.create('Ext.form.Panel', {
159 title: 'Multi Column, Nested Layouts and Anchoring',
160 bodyStyle:'padding:5px 5px 0',
177 fieldLabel: 'First Name',
182 fieldLabel: 'Company',
192 fieldLabel: 'Last Name',
206 fieldLabel: 'Biography',
218 top.render(document.body);
222 * ================ Form 4 =======================
224 bd.createChild({tag: 'h2', html: 'Form 4 - Forms can be a TabPanel...'});
228 var tabs = Ext.create('Ext.form.Panel', {
244 bodyStyle:'padding:10px'
248 title:'Personal Details',
249 defaultType: 'textfield',
252 fieldLabel: 'First Name',
257 fieldLabel: 'Last Name',
261 fieldLabel: 'Company',
270 title:'Phone Numbers',
271 defaultType: 'textfield',
276 value: '(888) 555-1212'
278 fieldLabel: 'Business',
281 fieldLabel: 'Mobile',
297 tabs.render(document.body);
302 * ================ Form 5 =======================
304 bd.createChild({tag: 'h2', html: 'Form 5 - ... and forms can contain TabPanel(s)'});
306 var tab2 = Ext.create('Ext.form.Panel', {
308 bodyStyle:'padding:5px',
325 defaultType: 'textfield',
327 fieldLabel: 'First Name',
331 fieldLabel: 'Company',
339 defaultType: 'textfield',
341 fieldLabel: 'Last Name',
356 defaults:{bodyStyle:'padding:10px'},
358 title:'Personal Details',
359 defaults: {width: 230},
360 defaultType: 'textfield',
363 fieldLabel: 'First Name',
368 fieldLabel: 'Last Name',
372 fieldLabel: 'Company',
381 title:'Phone Numbers',
382 defaults: {width: 230},
383 defaultType: 'textfield',
388 value: '(888) 555-1212'
390 fieldLabel: 'Business',
393 fieldLabel: 'Mobile',
406 fieldLabel: 'Biography'
418 tab2.render(document.body);