3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.menu.DateMenu"></div>/**
\r
10 * @class Ext.menu.DateMenu
\r
11 * @extends Ext.menu.Menu
\r
12 * <p>A menu containing an {@link Ext.DatePicker} Component.</p>
\r
13 * <p>Notes:</p><div class="mdetail-params"><ul>
\r
14 * <li>Although not listed here, the <b>constructor</b> for this class
\r
15 * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>
\r
16 * <li>If subclassing DateMenu, any configuration options for the DatePicker must be
\r
17 * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.
\r
18 * Applying {@link Ext.DatePicker DatePicker} configuration settings to
\r
19 * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>
\r
23 Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
\r
24 <div id="cfg-Ext.menu.DateMenu-enableScrolling"></div>/**
\r
25 * @cfg {Boolean} enableScrolling
\r
28 enableScrolling : false,
\r
29 <div id="cfg-Ext.menu.DateMenu-handler"></div>/**
\r
30 * @cfg {Function} handler
\r
31 * Optional. A function that will handle the select event of this menu.
\r
32 * The handler is passed the following parameters:<div class="mdetail-params"><ul>
\r
33 * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>
\r
34 * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
\r
37 <div id="cfg-Ext.menu.DateMenu-scope"></div>/**
\r
38 * @cfg {Object} scope
\r
39 * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
\r
40 * function will be called. Defaults to this DateMenu instance.
\r
42 <div id="cfg-Ext.menu.DateMenu-hideOnClick"></div>/**
\r
43 * @cfg {Boolean} hideOnClick
\r
44 * False to continue showing the menu after a date is selected, defaults to true.
\r
48 <div id="cfg-Ext.menu.DateMenu-pickerId"></div>/**
\r
49 * @cfg {String} pickerId
\r
50 * An id to assign to the underlying date picker. Defaults to <tt>null</tt>.
\r
54 <div id="cfg-Ext.menu.DateMenu-maxHeight"></div>/**
\r
55 * @cfg {Number} maxHeight
\r
58 <div id="cfg-Ext.menu.DateMenu-scrollIncrement"></div>/**
\r
59 * @cfg {Number} scrollIncrement
\r
62 <div id="prop-Ext.menu.DateMenu-picker"></div>/**
\r
63 * The {@link Ext.DatePicker} instance for this DateMenu
\r
67 cls : 'x-date-menu',
\r
69 <div id="event-Ext.menu.DateMenu-click"></div>/**
\r
74 <div id="event-Ext.menu.DateMenu-itemclick"></div>/**
\r
79 initComponent : function(){
\r
80 this.on('beforeshow', this.onBeforeShow, this);
\r
81 if(this.strict = (Ext.isIE7 && Ext.isStrict)){
\r
82 this.on('show', this.onShow, this, {single: true, delay: 20});
\r
86 showSeparator: false,
\r
87 items: this.picker = new Ext.DatePicker(Ext.applyIf({
\r
88 internalRender: this.strict || !Ext.isIE,
\r
89 ctCls: 'x-menu-date-item',
\r
91 }, this.initialConfig))
\r
93 this.picker.purgeListeners();
\r
94 Ext.menu.DateMenu.superclass.initComponent.call(this);
\r
95 <div id="event-Ext.menu.DateMenu-select"></div>/**
\r
97 * Fires when a date is selected from the {@link #picker Ext.DatePicker}
\r
98 * @param {DatePicker} picker The {@link #picker Ext.DatePicker}
\r
99 * @param {Date} date The selected date
\r
101 this.relayEvents(this.picker, ['select']);
\r
102 this.on('show', this.picker.focus, this.picker);
\r
103 this.on('select', this.menuHide, this);
\r
105 this.on('select', this.handler, this.scope || this);
\r
109 menuHide : function() {
\r
110 if(this.hideOnClick){
\r
115 onBeforeShow : function(){
\r
117 this.picker.hideMonthPicker(true);
\r
121 onShow : function(){
\r
122 var el = this.picker.getEl();
\r
123 el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode
\r
126 Ext.reg('datemenu', Ext.menu.DateMenu);
\r