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.
 
 
 

64 lines
1.8 KiB

/**
* 下拉框弹出层的多选版本,toolbar带有若干按钮, zIndex在1000w
* @class BI.MultiPopupView
* @extends BI.Widget
*/
BI.MultiPopupView = BI.inherit(BI.PopupView, {
_defaultConfig: function () {
var conf = BI.MultiPopupView.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-multi-list-view",
buttons: [BI.i18nText("BI-Basic_Sure")]
})
},
_init: function () {
BI.MultiPopupView.superclass._init.apply(this, arguments);
},
_createToolBar: function () {
var o = this.options, self = this;
if (o.buttons.length === 0) {
return;
}
var text = []; //构造[{text:content},……]
BI.each(o.buttons, function (idx, item) {
text.push({
text: item,
value: idx
})
});
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-border-top",
height: 30,
items: BI.createItems(text, {
type: "bi.text_button",
once: false,
shadow: true,
isShadowShowingOnSelected: true
}),
layouts: [{
type: "bi.center",
hgap: 0,
vgap: 0
}]
});
this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE, function (value, obj) {
self.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, value, obj);
});
return this.buttongroup;
}
});
BI.MultiPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON";
BI.shortcut("bi.multi_popup_view", BI.MultiPopupView);