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.
 
 
 

71 lines
1.8 KiB

/**
* 季度展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.QuarterPopup
* @extends BI.Trigger
*/
BI.QuarterPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.QuarterPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-quarter-popup"
});
},
_init: function () {
BI.QuarterPopup.superclass._init.apply(this, arguments);
var self = this;
var items = [{
text: Date._QN[01],
value: 1
}, {
text: Date._QN[2],
value: 2
}, {
text: Date._QN[3],
value: 3
}, {
text: Date._QN[4],
value: 4
}];
items = BI.map(items, function (j, item) {
return BI.extend(item, {
type: "bi.text_item",
cls: "bi-list-item-active",
textAlign: "left",
whiteSpace: "nowrap",
once: false,
forceSelected: true,
height: 25
});
});
this.quarter = BI.createWidget({
type: "bi.button_group",
element: this,
items: BI.createItems(items, {}),
layouts: [{
type: "bi.vertical"
}]
});
this.quarter.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.MonthPopup.EVENT_CHANGE);
}
})
},
getValue: function () {
return this.quarter.getValue()[0];
},
setValue: function (v) {
this.quarter.setValue([v]);
}
});
BI.QuarterPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.quarter_popup", BI.QuarterPopup);