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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
<div id="cls-Ext.calendar.CalendarPicker"></div>/**
* @class Ext.calendar.CalendarPicker
* @extends Ext.form.ComboBox
* <p>A custom combo used for choosing from the list of available calendars to assign an event to.</p>
* <p>This is pretty much a standard combo that is simply pre-configured for the options needed by the
* calendar components. The default configs are as follows:<pre><code>
fieldLabel: 'Calendar',
valueField: 'CalendarId',
displayField: 'Title',
triggerAction: 'all',
mode: 'local',
forceSelection: true,
width: 200
</code></pre>
* @constructor
* @param {Object} config The config object
*/
Ext.calendar.CalendarPicker = Ext.extend(Ext.form.ComboBox, {
fieldLabel: 'Calendar',
valueField: 'CalendarId',
displayField: 'Title',
triggerAction: 'all',
mode: 'local',
forceSelection: true,
width: 200,
// private
initComponent: function() {
Ext.calendar.CalendarPicker.superclass.initComponent.call(this);
this.tpl = this.tpl ||
'<tpl for="."><div class="x-combo-list-item ext-color-{' + this.valueField +
'}"><div class="ext-cal-picker-icon"> </div>{' + this.displayField + '}</div></tpl>';
},
// private
afterRender: function() {
Ext.calendar.CalendarPicker.superclass.afterRender.call(this);
this.wrap = this.el.up('.x-form-field-wrap');
this.wrap.addClass('ext-calendar-picker');
this.icon = Ext.DomHelper.append(this.wrap, {
tag: 'div',
cls: 'ext-cal-picker-icon ext-cal-picker-mainicon'
});
},
// inherited docs
setValue: function(value) {
this.wrap.removeClass('ext-color-' + this.getValue());
if (!value && this.store !== undefined) {
// always default to a valid calendar
value = this.store.getAt(0).data.CalendarId;
}
Ext.calendar.CalendarPicker.superclass.setValue.call(this, value);
this.wrap.addClass('ext-color-' + value);
}
});
Ext.reg('calendarpicker', Ext.calendar.CalendarPicker);
</pre>
</body>
</html>
|