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.
15 Ext.define('Ext.app.ContactForm', {
16 extend: 'Ext.form.Panel',
18 'Ext.data.ArrayStore',
19 'Ext.data.reader.Array',
20 'Ext.form.field.ComboBox',
23 formTitle: 'Contact Information (English)',
24 firstName: 'First Name',
26 surnamePrefix: 'Surname Prefix',
29 stateEmptyText: 'Choose a state...',
31 birth: 'Date of Birth',
34 initComponent : function(config) {
38 title: this.formTitle,
39 bodyStyle: 'padding:5px 5px 0',
41 defaultType: 'textfield',
46 fieldLabel: this.firstName,
50 fieldLabel: this.lastName,
53 fieldLabel: this.surnamePrefix,
57 fieldLabel: this.company,
59 }, Ext.create('Ext.form.field.ComboBox', {
60 fieldLabel: this.province,
62 store: Ext.create('Ext.data.ArrayStore', {
63 fields: ['provincie'],
64 data : Ext.exampledata.dutch_provinces // from dutch-provinces.js
66 displayField: 'provincie',
70 emptyText: this.stateEmptyText,
73 fieldLabel: this.email,
76 }, Ext.create('Ext.form.field.Date', {
77 fieldLabel: this.birth,
89 this.callParent(arguments);
94 'Ext.tip.QuickTipManager'
97 Ext.onReady(function(){
98 Ext.tip.QuickTipManager.init();
100 // turn on validation errors beside the field globally
101 Ext.form.field.Base.prototype.msgTarget = 'side';
103 var bd = Ext.getBody();
105 bd.createChild({tag: 'h2', html: 'Localized Contact Form'});
108 var simple = Ext.create('Ext.app.ContactForm', {});
109 simple.render(document.body);