|
|
@ -134,15 +134,10 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { |
|
|
|
this.button_group.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
this.button_group.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (opts.allowSelectAll) { |
|
|
|
var searchLoaderEventChangeName = opts.allowSelectAll ? BI.SelectList.EVENT_CHANGE : BI.ListPane.EVENT_CHANGE |
|
|
|
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () { |
|
|
|
this.button_group.on(searchLoaderEventChangeName, function () { |
|
|
|
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments); |
|
|
|
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); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_createItems: function (items) { |
|
|
|
_createItems: function (items) { |
|
|
@ -196,13 +191,23 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
|
|
|
|
v || (v = {}); |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
|
|
|
|
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
|
|
|
|
this.storeValue = BI.deepClone(v); |
|
|
|
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 () { |
|
|
|
getValue: function () { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
if (o.allowSelectAll) { |
|
|
|
return this.button_group.getValue(); |
|
|
|
return this.button_group.getValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, |
|
|
|
|
|
|
|
value: this.button_group.getValue(), |
|
|
|
|
|
|
|
assist: this.button_group.getNotSelectedValue() |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getAllButtons: function () { |
|
|
|
getAllButtons: function () { |
|
|
|