/** * * 在搜索框中输入文本弹出的面板 * @class BI.MultiSelectSearchPane * @extends Widget */ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { constants: { height: 24, lgap: 10, tgap: 5 }, _defaultConfig: function () { return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-multi-select-search-pane bi-card", itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, keywordGetter: BI.emptyFn, itemHeight: 24, }); }, _init: function () { BI.MultiSelectSearchPane.superclass._init.apply(this, arguments); var self = this, o = this.options; this.loader = BI.createWidget({ type: "bi.multi_select_search_loader", keywordGetter: o.keywordGetter, valueFormatter: o.valueFormatter, itemFormatter: o.itemFormatter, itemsCreator: function (op, callback) { o.itemsCreator.apply(self, [op, function (res) { callback(res); }]); }, itemHeight: o.itemHeight, value: o.value }); this.loader.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); this.resizer = BI.createWidget({ type: "bi.absolute", element: this, items: [{ el: this.loader, left: 0, right: 0, bottom: 0, top: 0, }], }); }, isAllSelected: function () { return this.loader.isAllSelected(); }, hasMatched: function () { }, setValue: function (v) { this.loader.setValue(v); }, getValue: function () { return this.loader.getValue(); }, empty: function () { this.loader.empty(); }, populate: function (items) { this.loader.populate.apply(this.loader, arguments); } }); BI.MultiSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane);