fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.6 KiB

8 years ago
/**
* 日期控件中的月份下拉框
*
* Created by GUY on 2015/9/7.
* @class BI.MonthDateCombo
* @extends BI.Trigger
*/
BI.MonthDateCombo = BI.inherit(BI.Trigger, {
8 years ago
_defaultConfig: function () {
8 years ago
return BI.extend( BI.MonthDateCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
height: 25
});
},
8 years ago
_init: function () {
8 years ago
BI.MonthDateCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.date_triangle_trigger"
});
this.popup = BI.createWidget({
type: "bi.month_popup"
});
8 years ago
this.popup.on(BI.YearPopup.EVENT_CHANGE, function () {
8 years ago
self.setValue(self.popup.getValue());
8 years ago
});
8 years ago
this.combo = BI.createWidget({
type: "bi.combo",
offsetStyle: "center",
8 years ago
element: this,
8 years ago
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: this.popup
}
8 years ago
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
8 years ago
self.combo.hideView();
self.fireEvent(BI.MonthDateCombo.EVENT_CHANGE);
});
},
8 years ago
setValue: function (v) {
this.trigger.setValue(v);
8 years ago
this.popup.setValue(v);
},
8 years ago
getValue: function () {
8 years ago
return this.popup.getValue();
}
});
BI.MonthDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
8 years ago
BI.shortcut("bi.month_date_combo", BI.MonthDateCombo);