DateMenu_wev8.js
2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*!
* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
/**
* @class Ext.menu.DateMenu
* @extends Ext.menu.Menu
* A menu containing a {@link Ext.DatePicker} Component.
* @xtype datemenu
*/
Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
/**
* @cfg {Boolean} enableScrolling
* @hide
*/
enableScrolling: false,
/**
* @cfg {Boolean} hideOnClick
* False to continue showing the menu after a date is selected, defaults to true.
*/
hideOnClick: true,
/**
* @cfg {Number} maxHeight
* @hide
*/
/**
* @cfg {Number} scrollIncrement
* @hide
*/
/**
* @property picker
* @type DatePicker
* The {@link Ext.DatePicker} instance for this DateMenu
*/
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.apply({
internalRender: this.strict || !Ext.isIE,
ctCls: 'x-menu-date-item'
}, this.initialConfig))
});
this.picker.purgeListeners();
Ext.menu.DateMenu.superclass.initComponent.call(this);
this.relayEvents(this.picker, ["select"]);
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);