Web UI for ARGUS server
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.

76 lines
2.5 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.calendar.CalendarPicker"></div>/**
  16. * @class Ext.calendar.CalendarPicker
  17. * @extends Ext.form.ComboBox
  18. * <p>A custom combo used for choosing from the list of available calendars to assign an event to.</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. fieldLabel: 'Calendar',
  22. valueField: 'CalendarId',
  23. displayField: 'Title',
  24. triggerAction: 'all',
  25. mode: 'local',
  26. forceSelection: true,
  27. width: 200
  28. </code></pre>
  29. * @constructor
  30. * @param {Object} config The config object
  31. */
  32. Ext.calendar.CalendarPicker = Ext.extend(Ext.form.ComboBox, {
  33. fieldLabel: 'Calendar',
  34. valueField: 'CalendarId',
  35. displayField: 'Title',
  36. triggerAction: 'all',
  37. mode: 'local',
  38. forceSelection: true,
  39. width: 200,
  40. // private
  41. initComponent: function() {
  42. Ext.calendar.CalendarPicker.superclass.initComponent.call(this);
  43. this.tpl = this.tpl ||
  44. '<tpl for="."><div class="x-combo-list-item ext-color-{' + this.valueField +
  45. '}"><div class="ext-cal-picker-icon">&nbsp;</div>{' + this.displayField + '}</div></tpl>';
  46. },
  47. // private
  48. afterRender: function() {
  49. Ext.calendar.CalendarPicker.superclass.afterRender.call(this);
  50. this.wrap = this.el.up('.x-form-field-wrap');
  51. this.wrap.addClass('ext-calendar-picker');
  52. this.icon = Ext.DomHelper.append(this.wrap, {
  53. tag: 'div',
  54. cls: 'ext-cal-picker-icon ext-cal-picker-mainicon'
  55. });
  56. },
  57. // inherited docs
  58. setValue: function(value) {
  59. this.wrap.removeClass('ext-color-' + this.getValue());
  60. if (!value && this.store !== undefined) {
  61. // always default to a valid calendar
  62. value = this.store.getAt(0).data.CalendarId;
  63. }
  64. Ext.calendar.CalendarPicker.superclass.setValue.call(this, value);
  65. this.wrap.addClass('ext-color-' + value);
  66. }
  67. });
  68. Ext.reg('calendarpicker', Ext.calendar.CalendarPicker);
  69. </pre>
  70. </body>
  71. </html>