/** * 简单的复选下拉树控件, 适用于数据量少的情况 * * Created by GUY on 2015/10/29. * @class BI.TreeValueChooserCombo * @extends BI.Widget */ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { _defaultConfig: function () { return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-tree-value-chooser-combo", width: 200, height: 30, items: null, itemsCreator: BI.emptyFn }); }, _init: function () { BI.TreeValueChooserCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; if (BI.isNotNull(o.items)) { this._initData(o.items); } this.combo = BI.createWidget({ type: "bi.multi_tree_combo", element: this, itemsCreator: BI.bind(this._itemsCreator, this), width: o.width, height: o.height }); this.combo.on(BI.MultiTreeCombo.EVENT_CONFIRM, function () { self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM); }); }, setValue: function (v) { this.combo.setValue(v); }, getValue: function () { return this.combo.getValue(); }, populate: function () { this.combo.populate.apply(this.combo, arguments); } }); BI.TreeValueChooserCombo.EVENT_CONFIRM = "TreeValueChooserCombo.EVENT_CONFIRM"; BI.shortcut("bi.tree_value_chooser_combo", BI.TreeValueChooserCombo);