- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
DateMenu.js
资源名称:ext-3.1.0.zip [点击查看]
上传用户:dawnssy
上传日期:2022-08-06
资源大小:9345k
文件大小:4k
源码类别:
JavaScript
开发平台:
JavaScript
- /*! * Ext JS Library 3.1.0 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ /**
- * @class Ext.menu.DateMenu
- * @extends Ext.menu.Menu
- * <p>A menu containing an {@link Ext.DatePicker} Component.</p>
- * <p>Notes:</p><div class="mdetail-params"><ul>
- * <li>Although not listed here, the <b>constructor</b> for this class
- * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>
- * <li>If subclassing DateMenu, any configuration options for the DatePicker must be
- * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.
- * Applying {@link Ext.DatePicker DatePicker} configuration settings to
- * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>
- * </ul></div>
- * @xtype datemenu
- */
- Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
- /**
- * @cfg {Boolean} enableScrolling
- * @hide
- */
- enableScrolling : false,
- /**
- * @cfg {Function} handler
- * Optional. A function that will handle the select event of this menu.
- * The handler is passed the following parameters:<div class="mdetail-params"><ul>
- * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>
- * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
- * </ul></div>
- */
- /**
- * @cfg {Object} scope
- * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
- * function will be called. Defaults to this DateMenu instance.
- */
- /**
- * @cfg {Boolean} hideOnClick
- * False to continue showing the menu after a date is selected, defaults to true.
- */
- hideOnClick : true,
- /**
- * @cfg {String} pickerId
- * An id to assign to the underlying date picker. Defaults to <tt>null</tt>.
- */
- pickerId : null,
- /**
- * @cfg {Number} maxHeight
- * @hide
- */
- /**
- * @cfg {Number} scrollIncrement
- * @hide
- */
- /**
- * The {@link Ext.DatePicker} instance for this DateMenu
- * @property picker
- * @type DatePicker
- */
- cls : 'x-date-menu',
- /**
- * @event click
- * @hide
- */
- /**
- * @event itemclick
- * @hide
- */
- initComponent : function(){
- this.on('beforeshow', this.onBeforeShow, this);
- if(this.strict = (Ext.isIE7 && Ext.isStrict)){
- this.on('show', this.onShow, this, {single: true, delay: 20});
- }
- Ext.apply(this, {
- plain: true,
- showSeparator: false,
- items: this.picker = new Ext.DatePicker(Ext.applyIf({
- internalRender: this.strict || !Ext.isIE,
- ctCls: 'x-menu-date-item',
- id: this.pickerId
- }, this.initialConfig))
- });
- this.picker.purgeListeners();
- Ext.menu.DateMenu.superclass.initComponent.call(this);
- /**
- * @event select
- * Fires when a date is selected from the {@link #picker Ext.DatePicker}
- * @param {DatePicker} picker The {@link #picker Ext.DatePicker}
- * @param {Date} date The selected date
- */
- this.relayEvents(this.picker, ['select']);
- this.on('show', this.picker.focus, this.picker);
- this.on('select', this.menuHide, this);
- if(this.handler){
- this.on('select', this.handler, this.scope || this);
- }
- },
- menuHide : function() {
- if(this.hideOnClick){
- this.hide(true);
- }
- },
- onBeforeShow : function(){
- if(this.picker){
- this.picker.hideMonthPicker(true);
- }
- },
- onShow : function(){
- var el = this.picker.getEl();
- el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode
- }
- });
- Ext.reg('datemenu', Ext.menu.DateMenu);