You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.8 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. This file is part of Ext JS 3.4
  3. Copyright (c) 2011-2013 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. GNU General Public License Usage
  6. This file may be used under the terms of the GNU General Public License version 3.0 as
  7. published by the Free Software Foundation and appearing in the file LICENSE included in the
  8. packaging of this file.
  9. Please review the following information to ensure the GNU General Public License version 3.0
  10. requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  11. If you are unsure which license is appropriate for your use, please contact the sales department
  12. at http://www.sencha.com/contact.
  13. Build date: 2013-04-03 15:07:25
  14. */
  15. /**
  16. * @class Ext.calendar.ReminderField
  17. * @extends Ext.form.ComboBox
  18. * <p>A custom combo used for choosing a reminder setting for an event.</p>
  19. * <p>This is pretty much a standard combo that is simply pre-configured for the options needed by the
  20. * calendar components. The default configs are as follows:<pre><code>
  21. width: 200,
  22. fieldLabel: 'Reminder',
  23. mode: 'local',
  24. triggerAction: 'all',
  25. forceSelection: true,
  26. displayField: 'desc',
  27. valueField: 'value'
  28. </code></pre>
  29. * @constructor
  30. * @param {Object} config The config object
  31. */
  32. Ext.calendar.ReminderField = Ext.extend(Ext.form.ComboBox, {
  33. width: 200,
  34. fieldLabel: 'Reminder',
  35. mode: 'local',
  36. triggerAction: 'all',
  37. forceSelection: true,
  38. displayField: 'desc',
  39. valueField: 'value',
  40. // private
  41. initComponent: function() {
  42. Ext.calendar.ReminderField.superclass.initComponent.call(this);
  43. this.store = this.store || new Ext.data.ArrayStore({
  44. fields: ['value', 'desc'],
  45. idIndex: 0,
  46. data: [
  47. ['', 'None'],
  48. ['0', 'At start time'],
  49. ['5', '5 minutes before start'],
  50. ['15', '15 minutes before start'],
  51. ['30', '30 minutes before start'],
  52. ['60', '1 hour before start'],
  53. ['90', '1.5 hours before start'],
  54. ['120', '2 hours before start'],
  55. ['180', '3 hours before start'],
  56. ['360', '6 hours before start'],
  57. ['720', '12 hours before start'],
  58. ['1440', '1 day before start'],
  59. ['2880', '2 days before start'],
  60. ['4320', '3 days before start'],
  61. ['5760', '4 days before start'],
  62. ['7200', '5 days before start'],
  63. ['10080', '1 week before start'],
  64. ['20160', '2 weeks before start']
  65. ]
  66. });
  67. },
  68. // inherited docs
  69. initValue: function() {
  70. if (this.value !== undefined) {
  71. this.setValue(this.value);
  72. }
  73. else {
  74. this.setValue('');
  75. }
  76. this.originalValue = this.getValue();
  77. }
  78. });
  79. Ext.reg('reminderfield', Ext.calendar.ReminderField);