3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
9 Ext.app.ContactForm = Ext.extend(Ext.FormPanel, {
10 formTitle: 'Contact Information (English)',
11 firstName: 'First Name',
13 surnamePrefix: 'Surname Prefix',
16 stateEmptyText: 'Choose a state...',
18 birth: 'Date of Birth',
22 initComponent : function(config) {
24 labelWidth: 100, // label settings here cascade unless overridden
27 title: this.formTitle,
28 bodyStyle:'padding:5px 5px 0',
30 defaults: {width: 220},
31 defaultType: 'textfield',
34 fieldLabel: this.firstName,
38 fieldLabel: this.lastName,
41 fieldLabel: this.surnamePrefix,
45 fieldLabel: this.company,
47 }, new Ext.form.ComboBox({
48 fieldLabel: this.province,
50 store: new Ext.data.ArrayStore({
51 fields: ['provincie'],
52 data : Ext.exampledata.dutch_provinces // from dutch-provinces.js
54 displayField: 'provincie',
58 emptyText: this.stateEmtyText,
62 fieldLabel: this.email,
65 }, new Ext.form.DateField({
66 fieldLabel: this.birth,
78 Ext.app.ContactForm.superclass.initComponent.apply(this, arguments);
82 Ext.onReady(function(){
85 // turn on validation errors beside the field globally
86 Ext.form.Field.prototype.msgTarget = 'side';
88 var bd = Ext.getBody();
90 bd.createChild({tag: 'h2', html: 'Localized Contact Form'});
93 var simple = new Ext.app.ContactForm();
94 simple.render(document.body);