]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Advanced validation examples using VTypes\r | |
3 | */\r | |
4 | Ext.define('KitchenSink.view.form.AdvancedVTypes', {\r | |
5 | extend: 'Ext.container.Container',\r | |
6 | xtype: 'form-advtypes',\r | |
7 | controller: 'form-advtypes',\r | |
8 | \r | |
9 | //<example>\r | |
10 | requires: [\r | |
11 | 'KitchenSink.AdvancedVType',\r | |
12 | 'KitchenSink.view.form.AdvancedVTypesController'\r | |
13 | ],\r | |
14 | \r | |
15 | exampleTitle: 'Advanced VTypes',\r | |
16 | otherContent: [{\r | |
17 | type: 'ViewController',\r | |
18 | path: 'classic/samples/view/form/AdvancedVTypesController.js'\r | |
19 | }, {\r | |
20 | type: 'VType',\r | |
21 | path: 'classic/samples/AdvancedVType.js'\r | |
22 | }],\r | |
23 | //</example>\r | |
24 | \r | |
25 | defaults: {\r | |
26 | style: {\r | |
27 | 'margin-bottom': '20px'\r | |
28 | }\r | |
29 | },\r | |
30 | \r | |
31 | width: 500,\r | |
32 | \r | |
33 | items: [{\r | |
34 | xtype: 'box', // same as 'component'\r | |
35 | html: [\r | |
36 | '<p>The first example shows two date fields acting as a date range. ',\r | |
37 | 'Selecting an initial date sets the minimum value for the end field. ',\r | |
38 | 'Selecting an ending date sets a maximum value for the start field.</p>'\r | |
39 | ]\r | |
40 | }, {\r | |
41 | xtype: 'form',\r | |
42 | title: 'Date Range',\r | |
43 | frame: true,\r | |
44 | bodyPadding: '5 5 0',\r | |
45 | \r | |
46 | style: {\r | |
47 | 'margin-bottom': '40px'\r | |
48 | },\r | |
49 | \r | |
50 | fieldDefaults: {\r | |
51 | msgTarget: 'side',\r | |
52 | autoFitErrors: false\r | |
53 | },\r | |
54 | \r | |
55 | layout: 'form',\r | |
56 | \r | |
57 | defaultType: 'datefield',\r | |
58 | \r | |
59 | items: [{\r | |
60 | fieldLabel: 'Start Date',\r | |
61 | name: 'startdt',\r | |
62 | itemId: 'startdt',\r | |
63 | vtype: 'daterange',\r | |
64 | endDateField: 'enddt' // id of the end date field\r | |
65 | }, {\r | |
66 | fieldLabel: 'End Date',\r | |
67 | name: 'enddt',\r | |
68 | itemId: 'enddt',\r | |
69 | vtype: 'daterange',\r | |
70 | startDateField: 'startdt' // id of the start date field\r | |
71 | }]\r | |
72 | }, {\r | |
73 | xtype: 'box',\r | |
74 | html: [\r | |
75 | '<p>This second example shows a password verification, the second value must be equivalent',\r | |
76 | 'to the first to validate.</p>'\r | |
77 | ]\r | |
78 | }, {\r | |
79 | xtype: 'form',\r | |
80 | frame: true,\r | |
81 | title: 'Password Verification',\r | |
82 | bodyPadding: '5 5 0',\r | |
83 | \r | |
84 | layout: 'form',\r | |
85 | \r | |
86 | fieldDefaults: {\r | |
87 | msgTarget: 'side',\r | |
88 | autoFitErrors: false\r | |
89 | },\r | |
90 | \r | |
91 | defaults: {\r | |
92 | inputType: 'password'\r | |
93 | },\r | |
94 | defaultType: 'textfield',\r | |
95 | \r | |
96 | items: [{\r | |
97 | fieldLabel: 'Password',\r | |
98 | name: 'pass',\r | |
99 | itemId: 'pass',\r | |
100 | allowBlank: false,\r | |
101 | listeners: {\r | |
102 | validitychange: 'validateField',\r | |
103 | blur: 'validateField'\r | |
104 | }\r | |
105 | }, {\r | |
106 | fieldLabel: 'Confirm Password',\r | |
107 | name: 'pass-cfrm',\r | |
108 | vtype: 'password',\r | |
109 | initialPassField: 'pass' // id of the initial password field\r | |
110 | }]\r | |
111 | }]\r | |
112 | });\r |