1 Ext.define('Ext.app.ContactForm', {
2 extend: 'Ext.form.Panel',
5 'Ext.data.reader.Array',
6 'Ext.form.field.ComboBox',
9 formTitle: 'Contact Information (English)',
10 firstName: 'First Name',
12 surnamePrefix: 'Surname Prefix',
15 stateEmptyText: 'Choose a state...',
17 birth: 'Date of Birth',
20 initComponent : function(config) {
24 title: this.formTitle,
25 bodyStyle: 'padding:5px 5px 0',
27 defaultType: 'textfield',
32 fieldLabel: this.firstName,
36 fieldLabel: this.lastName,
39 fieldLabel: this.surnamePrefix,
43 fieldLabel: this.company,
45 }, Ext.create('Ext.form.field.ComboBox', {
46 fieldLabel: this.province,
48 store: Ext.create('Ext.data.ArrayStore', {
49 fields: ['provincie'],
50 data : Ext.exampledata.dutch_provinces // from dutch-provinces.js
52 displayField: 'provincie',
56 emptyText: this.stateEmptyText,
59 fieldLabel: this.email,
62 }, Ext.create('Ext.form.field.Date', {
63 fieldLabel: this.birth,
75 this.callParent(arguments);
80 'Ext.tip.QuickTipManager'
83 Ext.onReady(function(){
84 Ext.tip.QuickTipManager.init();
86 // turn on validation errors beside the field globally
87 Ext.form.field.Base.prototype.msgTarget = 'side';
89 var bd = Ext.getBody();
91 bd.createChild({tag: 'h2', html: 'Localized Contact Form'});
94 var simple = Ext.create('Ext.app.ContactForm', {});
95 simple.render(document.body);