/** * 下拉框弹出层的多选版本,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);