3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * A menu containing an Ext.picker.Date Component.
20 * - Although not listed here, the **constructor** for this class accepts all of the
21 * configuration options of **{@link Ext.picker.Date}**.
22 * - If subclassing DateMenu, any configuration options for the DatePicker must be applied
23 * to the **initialConfig** property of the DateMenu. Applying {@link Ext.picker.Date Date Picker}
24 * configuration settings to **this** will **not** affect the Date Picker's configuration.
29 * var dateMenu = Ext.create('Ext.menu.DatePicker', {
30 * handler: function(dp, date){
31 * Ext.Msg.alert('Date Selected', 'You selected ' + Ext.Date.format(date, 'M j, Y'));
35 * Ext.create('Ext.menu.Menu', {
38 * floating: false, // usually you want this set to True (default)
39 * renderTo: Ext.getBody(), // usually rendered by it's containing component
41 * text: 'choose a date',
47 * text: 'regular item'
51 Ext.define('Ext.menu.DatePicker', {
52 extend: 'Ext.menu.Menu',
54 alias: 'widget.datemenu',
61 * @cfg {Boolean} hideOnClick
62 * False to continue showing the menu after a date is selected.
67 * @cfg {String} pickerId
68 * An id to assign to the underlying date picker.
73 * @cfg {Number} maxHeight
78 * @property {Ext.picker.Date} picker
79 * The {@link Ext.picker.Date} instance for this DateMenu
92 initComponent : function(){
99 bodyPadding: 0, // remove the body padding from the datepicker menu item so it looks like 3.3
101 cls: Ext.baseCSSPrefix + 'menu-date-item',
107 me.callParent(arguments);
109 me.picker = me.down('datepicker');
112 * @alias Ext.picker.Date#select
114 me.relayEvents(me.picker, ['select']);
116 if (me.hideOnClick) {
117 me.on('select', me.hidePickerOnSelect, me);
121 hidePickerOnSelect: function() {
122 Ext.menu.Manager.hideAll();