3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 * @class Ext.menu.DateMenu
\r
9 * @extends Ext.menu.Menu
\r
10 * A menu containing a {@link Ext.DatePicker} Component.
\r
13 Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
\r
15 * @cfg {Boolean} enableScrolling
\r
18 enableScrolling: false,
\r
21 * @cfg {Boolean} hideOnClick
\r
22 * False to continue showing the menu after a date is selected, defaults to true.
\r
27 * @cfg {Number} maxHeight
\r
31 * @cfg {Number} scrollIncrement
\r
37 * The {@link Ext.DatePicker} instance for this DateMenu
\r
51 initComponent: function(){
\r
52 this.on('beforeshow', this.onBeforeShow, this);
\r
53 if(this.strict = (Ext.isIE7 && Ext.isStrict)){
\r
54 this.on('show', this.onShow, this, {single: true, delay: 20});
\r
58 showSeparator: false,
\r
59 items: this.picker = new Ext.DatePicker(Ext.apply({
\r
60 internalRender: this.strict || !Ext.isIE,
\r
61 ctCls: 'x-menu-date-item'
\r
62 }, this.initialConfig))
\r
64 this.picker.purgeListeners();
\r
65 Ext.menu.DateMenu.superclass.initComponent.call(this);
\r
66 this.relayEvents(this.picker, ["select"]);
\r
67 this.on('select', this.menuHide, this);
\r
69 this.on('select', this.handler, this.scope || this);
\r
73 menuHide: function() {
\r
74 if(this.hideOnClick){
\r
79 onBeforeShow: function(){
\r
81 this.picker.hideMonthPicker(true);
\r
86 var el = this.picker.getEl();
\r
87 el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode
\r
90 Ext.reg('datemenu', Ext.menu.DateMenu);