diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/src/widget/multiselect/search/multiselect.search.loader.js index 9029a94ed..7ccda9374 100644 --- a/src/widget/multiselect/search/multiselect.search.loader.js +++ b/src/widget/multiselect/search/multiselect.search.loader.js @@ -123,7 +123,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }; callback(firstItems.concat(self._createItems(ob.items)), keyword, context); if (op.times === 1 && self.storeValue) { - self.setValue(self.storeValue); + self.setValue(self.storeValue.value); } }); }, @@ -134,15 +134,10 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { this.button_group.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); - if (opts.allowSelectAll) { - this.button_group.on(BI.SelectList.EVENT_CHANGE, function () { - self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments); - }); - } else { - this.button_group.on(BI.ListPane.EVENT_CHANGE, function (val) { - self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, val); - }); - } + var searchLoaderEventChangeName = opts.allowSelectAll ? BI.SelectList.EVENT_CHANGE : BI.ListPane.EVENT_CHANGE + this.button_group.on(searchLoaderEventChangeName, function () { + self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments); + }); }, _createItems: function (items) { @@ -202,7 +197,15 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }, getValue: function () { - return this.button_group.getValue(); + var o = this.options; + if (o.allowSelectAll) { + return this.button_group.getValue(); + } + return { + type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, + value: this.button_group.getValue(), + assist: this.button_group.getNotSelectedValue() + }; }, getAllButtons: function () {