4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-menu-DatePicker'>/**
19 </span> * A menu containing an Ext.picker.Date Component.
23 * - Although not listed here, the **constructor** for this class accepts all of the
24 * configuration options of **{@link Ext.picker.Date}**.
25 * - If subclassing DateMenu, any configuration options for the DatePicker must be applied
26 * to the **initialConfig** property of the DateMenu. Applying {@link Ext.picker.Date Date Picker}
27 * configuration settings to **this** will **not** affect the Date Picker's configuration.
32 * var dateMenu = Ext.create('Ext.menu.DatePicker', {
33 * handler: function(dp, date){
34 * Ext.Msg.alert('Date Selected', 'You selected ' + Ext.Date.format(date, 'M j, Y'));
38 * Ext.create('Ext.menu.Menu', {
41 * floating: false, // usually you want this set to True (default)
42 * renderTo: Ext.getBody(), // usually rendered by it's containing component
44 * text: 'choose a date',
50 * text: 'regular item'
54 Ext.define('Ext.menu.DatePicker', {
55 extend: 'Ext.menu.Menu',
57 alias: 'widget.datemenu',
63 <span id='Ext-menu-DatePicker-cfg-hideOnClick'> /**
64 </span> * @cfg {Boolean} hideOnClick
65 * False to continue showing the menu after a date is selected.
69 <span id='Ext-menu-DatePicker-cfg-pickerId'> /**
70 </span> * @cfg {String} pickerId
71 * An id to assign to the underlying date picker.
75 <span id='Ext-menu-DatePicker-cfg-maxHeight'> /**
76 </span> * @cfg {Number} maxHeight
80 <span id='Ext-menu-DatePicker-property-picker'> /**
81 </span> * @property {Ext.picker.Date} picker
82 * The {@link Ext.picker.Date} instance for this DateMenu
85 <span id='Ext-menu-DatePicker-event-click'> /**
86 </span> * @event click
90 <span id='Ext-menu-DatePicker-event-itemclick'> /**
91 </span> * @event itemclick
95 initComponent : function(){
102 bodyPadding: 0, // remove the body padding from the datepicker menu item so it looks like 3.3
104 cls: Ext.baseCSSPrefix + 'menu-date-item',
110 me.callParent(arguments);
112 me.picker = me.down('datepicker');
113 <span id='Ext-menu-DatePicker-event-select'> /**
114 </span> * @event select
115 * @alias Ext.picker.Date#select
117 me.relayEvents(me.picker, ['select']);
119 if (me.hideOnClick) {
120 me.on('select', me.hidePickerOnSelect, me);
124 hidePickerOnSelect: function() {
125 Ext.menu.Manager.hideAll();