Browse Source

feature: 选中数据支持分页

es6
guy 2 years ago
parent
commit
7def0a8f81
  1. 6
      src/base/combination/group.button.js
  2. 12
      src/case/layer/pane.list.js
  3. 10
      src/case/list/list.select.js
  4. 5
      src/widget/multiselect/loader.js

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

@ -244,6 +244,12 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
});
},
setAllSelected: function (v) {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
},
getNotSelectedValue: function () {
var v = [];
BI.each(this.buttons, function (i, item) {

12
src/case/layer/pane.list.js

@ -150,6 +150,16 @@ BI.ListPane = BI.inherit(BI.Pane, {
this.button_group.setValue.apply(this.button_group, arguments);
},
setAllSelected: function (v) {
if (this.button_group.setAllSelected) {
this.button_group.setAllSelected(v);
} else {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
}
},
getValue: function () {
return this.button_group.getValue.apply(this.button_group, arguments);
},
@ -183,4 +193,4 @@ BI.ListPane = BI.inherit(BI.Pane, {
}
});
BI.ListPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.list_pane", BI.ListPane);
BI.shortcut("bi.list_pane", BI.ListPane);

10
src/case/list/list.select.js

@ -113,9 +113,13 @@ BI.SelectList = BI.inherit(BI.Widget, {
},
setAllSelected: function (v) {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
if (this.list.setAllSelected) {
this.list.setAllSelected(v);
} else {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
}
this.allSelected = !!v;
this.toolbar.setSelected(v);
this.toolbar.setHalfSelected(false);

5
src/widget/multiselect/loader.js

@ -204,6 +204,11 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
return this.cachGroup.getNotSelectedValue();
},
setAllSelected: function (v) {
this.button_group.setAllSelected(v);
this.cachGroup.setAllSelected(v);
},
setValue: function (value) {
var map = BI.makeObject(value);
this.cachGroup.setValueMap.call(this.cachGroup, map);

Loading…
Cancel
Save