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.
74 lines
2.0 KiB
74 lines
2.0 KiB
8 years ago
|
/**
|
||
|
*
|
||
|
* 在搜索框中输入文本弹出的面板
|
||
|
* @class BI.MultiTreeSearchPane
|
||
|
* @extends BI.Pane
|
||
|
*/
|
||
|
|
||
|
BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
|
||
|
|
||
|
_defaultConfig: function () {
|
||
|
return BI.extend(BI.MultiTreeSearchPane.superclass._defaultConfig.apply(this, arguments), {
|
||
8 years ago
|
baseCls: "bi-multi-tree-search-pane bi-card",
|
||
8 years ago
|
itemsCreator: BI.emptyFn,
|
||
|
keywordGetter: BI.emptyFn
|
||
|
});
|
||
|
},
|
||
|
|
||
|
_init: function () {
|
||
|
BI.MultiTreeSearchPane.superclass._init.apply(this, arguments);
|
||
|
|
||
|
var self = this, opts = this.options;
|
||
|
|
||
|
this.partTree = BI.createWidget({
|
||
|
type: "bi.part_tree",
|
||
|
element: this,
|
||
|
tipText: BI.i18nText("BI-No_Select"),
|
||
|
itemsCreator: function (op, callback) {
|
||
|
op.keyword = opts.keywordGetter();
|
||
|
opts.itemsCreator(op, callback);
|
||
7 years ago
|
},
|
||
|
value: opts.value
|
||
8 years ago
|
});
|
||
|
|
||
|
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
|
||
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
|
||
|
});
|
||
|
|
||
|
this.partTree.on(BI.TreeView.EVENT_CHANGE, function () {
|
||
|
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE);
|
||
|
});
|
||
|
},
|
||
|
|
||
|
hasChecked: function () {
|
||
|
return this.partTree.hasChecked();
|
||
|
},
|
||
|
|
||
|
setValue: function (v) {
|
||
8 years ago
|
this.setSelectedValue(v.value);
|
||
|
},
|
||
|
|
||
|
setSelectedValue: function (v) {
|
||
8 years ago
|
v || (v = {});
|
||
8 years ago
|
this.partTree.setSelectedValue(v);
|
||
8 years ago
|
},
|
||
|
|
||
|
getValue: function () {
|
||
|
return this.partTree.getValue();
|
||
|
},
|
||
|
|
||
|
empty: function () {
|
||
|
this.partTree.empty();
|
||
|
},
|
||
|
|
||
|
populate: function (op) {
|
||
|
this.partTree.stroke.apply(this.partTree, arguments);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
BI.MultiTreeSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
|
||
|
|
||
|
BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
|
||
|
BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
|
||
|
|
||
8 years ago
|
BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane);
|