]> git.proxmox.com Git - extjs.git/blame - extjs/build/examples/classic/calendar/src/form/field/ReminderCombo.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / examples / classic / calendar / src / form / field / ReminderCombo.js
CommitLineData
6527f429
DM
1/**\r
2 * @class Ext.calendar.form.field.ReminderCombo\r
3 * @extends Ext.form.ComboBox\r
4 * <p>A custom combo used for choosing a reminder setting for an event.</p>\r
5 * <p>This is pretty much a standard combo that is simply pre-configured for the options needed by the\r
6 * calendar components. The default configs are as follows:<pre><code>\r
7 width: 200,\r
8 fieldLabel: 'Reminder',\r
9 queryMode: 'local',\r
10 triggerAction: 'all',\r
11 forceSelection: true,\r
12 displayField: 'desc',\r
13 valueField: 'value'\r
14</code></pre>\r
15 * @constructor\r
16 * @param {Object} config The config object\r
17 */\r
18Ext.define('Ext.calendar.form.field.ReminderCombo', {\r
19 extend: 'Ext.form.field.ComboBox',\r
20 alias: 'widget.reminderfield',\r
21\r
22 fieldLabel: 'Reminder',\r
23 queryMode: 'local',\r
24 triggerAction: 'all',\r
25 forceSelection: true,\r
26 displayField: 'desc',\r
27 valueField: 'value',\r
28\r
29 // private\r
30 initComponent: function() {\r
31 this.store = this.store || new Ext.data.ArrayStore({\r
32 fields: ['value', 'desc'],\r
33 idIndex: 0,\r
34 data: [\r
35 ['', 'None'],\r
36 ['0', 'At start time'],\r
37 ['5', '5 minutes before start'],\r
38 ['15', '15 minutes before start'],\r
39 ['30', '30 minutes before start'],\r
40 ['60', '1 hour before start'],\r
41 ['90', '1.5 hours before start'],\r
42 ['120', '2 hours before start'],\r
43 ['180', '3 hours before start'],\r
44 ['360', '6 hours before start'],\r
45 ['720', '12 hours before start'],\r
46 ['1440', '1 day before start'],\r
47 ['2880', '2 days before start'],\r
48 ['4320', '3 days before start'],\r
49 ['5760', '4 days before start'],\r
50 ['7200', '5 days before start'],\r
51 ['10080', '1 week before start'],\r
52 ['20160', '2 weeks before start']\r
53 ]\r
54 });\r
55\r
56 this.callParent();\r
57 },\r
58\r
59 // inherited docs\r
60 initValue: function() {\r
61 if (this.value !== undefined) {\r
62 this.setValue(this.value);\r
63 }\r
64 else {\r
65 this.setValue('');\r
66 }\r
67 this.originalValue = this.getValue();\r
68 }\r
69});\r