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.

68 lines
2.1 KiB

/**
* 查看已选按钮
* Created by guy on 15/11/3.
* @class BI.MultiTreeCheckSelectedButton
* @extends BI.Single
*/
BI.MultiTreeCheckSelectedButton = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this, arguments), {
7 years ago
baseCls: "bi-multi-tree-check-selected-button",
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.MultiTreeCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
this.indicator = BI.createWidget({
7 years ago
type: "bi.icon_button",
7 years ago
cls: "check-font trigger-check-selected icon-size-12",
width: 15,
height: 15,
stopPropagation: true
});
this.checkSelected = BI.createWidget({
7 years ago
type: "bi.text_button",
cls: "trigger-check-selected",
invisible: true,
hgap: 4,
7 years ago
text: BI.i18nText("BI-Check_Selected"),
7 years ago
textAlign: "center",
textHeight: 15
});
this.checkSelected.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.checkSelected.on(BI.TextButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE, arguments);
});
BI.createWidget({
type: "bi.horizontal",
element: this,
items: [this.indicator, this.checkSelected]
7 years ago
});
this.element.hover(function () {
self.indicator.setVisible(false);
self.checkSelected.setVisible(true);
}, function () {
self.indicator.setVisible(true);
self.checkSelected.setVisible(false);
});
this.setVisible(false);
},
setValue: function (v) {
v || (v = {});
var show = BI.size(v.value) > 0;
this.setVisible(show);
}
});
BI.MultiTreeCheckSelectedButton.EVENT_CHANGE = "EVENT_CHANGE";
7 years ago
BI.shortcut("bi.multi_tree_check_selected_button", BI.MultiTreeCheckSelectedButton);