1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
| Ext.require([
| 'Ext.direct.*',
| 'Ext.form.Panel',
| 'Ext.form.field.Text',
| 'Ext.form.field.Number'
| ]);
|
| Ext.onReady(function(){
| Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
|
| var form = Ext.create('Ext.form.Panel', {
| width: 300,
| height: 130,
| renderTo: document.body,
| bodyPadding: 5,
| items: [{
| xtype: 'textfield',
| fieldLabel: 'First Name',
| name: 'firstName',
| value: 'Evan',
| allowBlank: false,
| maxLength: 30,
| enforceMaxLength: true
| }, {
| xtype: 'textfield',
| fieldLabel: 'Last Name',
| name: 'lastName',
| value: 'Trimboli',
| allowBlank: false,
| maxLength: 30,
| enforceMaxLength: true
| }, {
| xtype: 'numberfield',
| fieldLabel: 'Age',
| name: 'age',
| value: 25,
| allowBlank: false
| }],
| dockedItems: [{
| dock: 'bottom',
| ui: 'footer',
| xtype: 'toolbar',
| items: ['->', {
| formBind: true,
| text: 'Send',
| handler: function(){
| var values = form.getForm().getValues();
| TestAction.showDetails(values, function(value){
| Ext.example.msg('Server Response', value);
| });
| }
| }]
| }]
| });
| });
|
|