|
|
|
@ -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) { |
|
|
|
@ -196,13 +191,23 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
v || (v = {}); |
|
|
|
|
var o = this.options; |
|
|
|
|
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
|
|
|
|
|
this.storeValue = BI.deepClone(v); |
|
|
|
|
this.button_group.setValue(v); |
|
|
|
|
o.allowSelectAll ? (this.button_group.setValue(v)) : (this.button_group.setValue(v.value)); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
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 () { |
|
|
|
|