3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
17 'Ext.layout.container.Column',
23 * Ext JS Library 3.3.1
24 * Copyright(c) 2006-2010 Sencha Inc.
25 * licensing@sencha.com
26 * http://www.sencha.com/license
28 Ext.onReady(function(){
32 var bd = Ext.getBody();
35 * ================ Simple form =======================
37 bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'});
40 var simple = Ext.create('Ext.form.Panel', {
44 bodyStyle:'padding:5px 5px 0',
50 defaultType: 'textfield',
56 fieldLabel: 'First Name',
60 fieldLabel: 'Last Name',
63 fieldLabel: 'Company',
84 simple.render(document.body);
88 * ================ Form 2 =======================
90 bd.createChild({tag: 'h2', html: 'Form 2 - Adding fieldsets'});
92 var fsf = Ext.create('Ext.form.Panel', {
95 title: 'Simple Form with FieldSets',
96 bodyStyle:'padding:5px 5px 0',
109 title: 'User Information',
110 defaultType: 'textfield',
117 fieldLabel: 'First Name',
121 fieldLabel: 'Last Name',
124 fieldLabel: 'Company',
133 title: 'Phone Number',
135 defaultType: 'textfield',
143 value: '(888) 555-1212'
145 fieldLabel: 'Business',
148 fieldLabel: 'Mobile',
163 fsf.render(document.body);
166 * ================ Form 3 =======================
168 bd.createChild({tag: 'h2', html: 'Form 3 - A little more complex'});
171 var top = Ext.create('Ext.form.Panel', {
173 title: 'Multi Column, Nested Layouts and Anchoring',
174 bodyStyle:'padding:5px 5px 0',
191 fieldLabel: 'First Name',
196 fieldLabel: 'Company',
206 fieldLabel: 'Last Name',
220 fieldLabel: 'Biography',
232 top.render(document.body);
236 * ================ Form 4 =======================
238 bd.createChild({tag: 'h2', html: 'Form 4 - Forms can be a TabPanel...'});
242 var tabs = Ext.create('Ext.form.Panel', {
258 bodyStyle:'padding:10px'
262 title:'Personal Details',
263 defaultType: 'textfield',
266 fieldLabel: 'First Name',
271 fieldLabel: 'Last Name',
275 fieldLabel: 'Company',
284 title:'Phone Numbers',
285 defaultType: 'textfield',
290 value: '(888) 555-1212'
292 fieldLabel: 'Business',
295 fieldLabel: 'Mobile',
311 tabs.render(document.body);
316 * ================ Form 5 =======================
318 bd.createChild({tag: 'h2', html: 'Form 5 - ... and forms can contain TabPanel(s)'});
320 var tab2 = Ext.create('Ext.form.Panel', {
322 bodyStyle:'padding:5px',
339 defaultType: 'textfield',
341 fieldLabel: 'First Name',
345 fieldLabel: 'Company',
353 defaultType: 'textfield',
355 fieldLabel: 'Last Name',
370 defaults:{bodyStyle:'padding:10px'},
372 title:'Personal Details',
373 defaults: {width: 230},
374 defaultType: 'textfield',
377 fieldLabel: 'First Name',
382 fieldLabel: 'Last Name',
386 fieldLabel: 'Company',
395 title:'Phone Numbers',
396 defaults: {width: 230},
397 defaultType: 'textfield',
402 value: '(888) 555-1212'
404 fieldLabel: 'Business',
407 fieldLabel: 'Mobile',
420 fieldLabel: 'Biography'
432 tab2.render(document.body);