//继承DateFeld重写onTriggerClick方法
DateFieldEx = Ext.extend(Ext.form.DateField, {
onTriggerClick : function() {
DateFieldEx.superclass.onTriggerClick.call(this, arguments);
if (this.format.indexOf('d') == -1) {
this.menu.picker.monthPicker.slideIn = function() {
this.show()
}
this.menu.picker.hideMonthPicker = function() {
this.monthPicker.hide();
var v = this.activeDate
if (v) {
this.setValue(new Date(v))
this.fireEvent('select', this, this.value);
}
}
this.menu.picker.showMonthPicker()
}
}
})
1 楼
wmj007
2012-03-08
很好用的修改,修改不多,但功能实现,我喜欢,感谢分享
2 楼
wmj007
2012-03-08
有个问题,如果在重置格式为‘y-m-d’时选择月后,不能恢复之前的效果