Browse Source

feature: 选中数据支持分页

es6
guy 2 years ago
parent
commit
82e0424535
  1. 11
      src/base/combination/group.button.js
  2. 7
      src/widget/multiselect/loader.js

11
src/base/combination/group.button.js

@ -233,6 +233,17 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
}); });
}, },
setValueMap: function (map) {
map = map || {};
BI.each(this.buttons, function (i, item) {
if (BI.isNotNull(map[item.getValue()])) {
item.setSelected && item.setSelected(true);
} else {
item.setSelected && item.setSelected(false);
}
});
},
getNotSelectedValue: function () { getNotSelectedValue: function () {
var v = []; var v = [];
BI.each(this.buttons, function (i, item) { BI.each(this.buttons, function (i, item) {

7
src/widget/multiselect/loader.js

@ -204,9 +204,10 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
return this.cachGroup.getNotSelectedValue(); return this.cachGroup.getNotSelectedValue();
}, },
setValue: function () { setValue: function (value) {
this.cachGroup.setValue.apply(this.cachGroup, arguments); var map = BI.makeObject(value);
this.button_group.setValue.apply(this.button_group, arguments); this.cachGroup.setValueMap.call(this.cachGroup, map);
this.button_group.setValueMap.call(this.button_group, map);
}, },
getValue: function () { getValue: function () {

Loading…
Cancel
Save