diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 23d5385b8..a564dce78 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -284,11 +284,13 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { var self = this; var o = this.options; o.itemsCreator(op, function (res) { + var args = Array.prototype.slice.call(arguments); if (op.times === 1 && BI.isNotNull(op.keywords)) { // 预防trigger内部把当前的storeValue改掉 self.trigger.setValue(BI.deepClone(self.getValue())); } - callback.apply(self, arguments); + args.push(op); + callback.apply(self, args); }); }, diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index b1b4a202e..8001ada8d 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -285,11 +285,13 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { _itemsCreator4Trigger: function (op, callback) { var self = this, o = this.options; o.itemsCreator(op, function (res) { + var args = Array.prototype.slice.call(arguments); if (op.times === 1 && BI.isNotNull(op.keywords)) { // 预防trigger内部把当前的storeValue改掉 self.trigger.setValue(BI.deepClone(self.getValue())); } - callback.apply(self, arguments); + args.push(op); + callback.apply(self, args); }); }, diff --git a/src/widget/multiselect/trigger/button.checkselected.js b/src/widget/multiselect/trigger/button.checkselected.js index 47a5ca995..17468061f 100644 --- a/src/widget/multiselect/trigger/button.checkselected.js +++ b/src/widget/multiselect/trigger/button.checkselected.js @@ -40,7 +40,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, { self.numberCounter.setText(self.numberCounter.getTag()); }); this.setVisible(false); - if(BI.isNotNull(o.value)){ + if (BI.isNotNull(o.value)) { this.setValue(o.value); } }, @@ -51,6 +51,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, { o.itemsCreator({ type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH }, function (res) { + if (self.options.value.type !== BI.Selection.All) { + return; + } if (BI.isNotEmptyString(res.count)) { BI.nextTick(function () { self.numberCounter.setText(res.count); diff --git a/src/widget/multiselect/trigger/searcher.multiselect.insert.js b/src/widget/multiselect/trigger/searcher.multiselect.insert.js index 404a0e4e8..6fe8e0375 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.insert.js +++ b/src/widget/multiselect/trigger/searcher.multiselect.insert.js @@ -62,8 +62,14 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, { itemsCreator: function (op, callback) { var keyword = self.editor.getKeyword(); op.keywords = [keyword]; + self.op = op; this.setKeyword(keyword); - o.itemsCreator(op, callback); + o.itemsCreator(op, function () { + var args = Array.prototype.slice.call(arguments); + if (BI.last(args) === self.op) { + callback.apply(null, args); + } + }); }, itemHeight: o.itemHeight, value: o.value, @@ -174,7 +180,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, { } }, - getState: function() { + getState: function () { return this.editor.getState(); }, diff --git a/src/widget/multiselect/trigger/searcher.multiselect.js b/src/widget/multiselect/trigger/searcher.multiselect.js index ab2688eb4..651540981 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.js +++ b/src/widget/multiselect/trigger/searcher.multiselect.js @@ -51,7 +51,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, { callback(); }, el: this.editor, - popup: BI.extend({ type: "bi.multi_select_search_pane", valueFormatter: o.valueFormatter, @@ -61,7 +60,13 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, { itemsCreator: function (op, callback) { var keyword = self.editor.getValue(); op.keywords = [keyword]; - o.itemsCreator(op, callback); + self.op = op; + o.itemsCreator(op, function () { + var args = Array.prototype.slice.call(arguments); + if (BI.last(args) === self.op) { + callback.apply(null, args); + } + }); }, itemHeight: o.itemHeight, value: o.value