1 | /* |
---|
2 | * Ext JS Library 2.2.1 |
---|
3 | * Copyright(c) 2006-2009, Ext JS, LLC. |
---|
4 | * licensing@extjs.com |
---|
5 | * |
---|
6 | * http://extjs.com/license |
---|
7 | */ |
---|
8 | |
---|
9 | Ext.onReady(function(){ |
---|
10 | |
---|
11 | Ext.QuickTips.init(); |
---|
12 | |
---|
13 | // turn on validation errors beside the field globally |
---|
14 | Ext.form.Field.prototype.msgTarget = 'side'; |
---|
15 | |
---|
16 | var bd = Ext.getBody(); |
---|
17 | |
---|
18 | bd.createChild({tag: 'h2', html: 'Dutch Form'}) |
---|
19 | |
---|
20 | // simple form |
---|
21 | var simple = new Ext.FormPanel({ |
---|
22 | labelWidth: 100, // label settings here cascade unless overridden |
---|
23 | url:'save-form.php', |
---|
24 | frame:true, |
---|
25 | title: 'Contact Informatie (Dutch)', |
---|
26 | bodyStyle:'padding:5px 5px 0', |
---|
27 | width: 350, |
---|
28 | defaults: {width: 220}, |
---|
29 | defaultType: 'textfield', |
---|
30 | |
---|
31 | items: [{ |
---|
32 | fieldLabel: 'Voornaam', |
---|
33 | name: 'voornaam', |
---|
34 | allowBlank:false |
---|
35 | },{ |
---|
36 | fieldLabel: 'Achternaam', |
---|
37 | name: 'achternaam' |
---|
38 | },{ |
---|
39 | fieldLabel: 'Tussenvoegsel', |
---|
40 | width: 50, |
---|
41 | name: 'tussenvoegsel' |
---|
42 | },{ |
---|
43 | fieldLabel: 'Bedrijf', |
---|
44 | name: 'bedrijf' |
---|
45 | }, new Ext.form.ComboBox({ |
---|
46 | fieldLabel: 'Provincie', |
---|
47 | hiddenName: 'state', |
---|
48 | store: new Ext.data.SimpleStore({ |
---|
49 | fields: ['provincie'], |
---|
50 | data : Ext.exampledata.dutch_provinces // from dutch-provinces.js |
---|
51 | }), |
---|
52 | displayField: 'provincie', |
---|
53 | typeAhead: true, |
---|
54 | mode: 'local', |
---|
55 | triggerAction: 'all', |
---|
56 | emptyText:'Kies een provincie...', |
---|
57 | selectOnFocus:true, |
---|
58 | width:190 |
---|
59 | }), { |
---|
60 | fieldLabel: 'E-mail', |
---|
61 | name: 'email', |
---|
62 | vtype:'email' |
---|
63 | }, new Ext.form.DateField({ |
---|
64 | fieldLabel: 'Geb. Datum', |
---|
65 | name: 'geb_datum' |
---|
66 | }) |
---|
67 | ], |
---|
68 | |
---|
69 | buttons: [{ |
---|
70 | text: 'Opslaan' |
---|
71 | },{ |
---|
72 | text: 'Annuleren' |
---|
73 | }] |
---|
74 | }); |
---|
75 | |
---|
76 | simple.render(document.body); |
---|
77 | }); |
---|