Browse Source

feature: 选中数据支持分页

es6
guy 2 years ago
parent
commit
f15b0f1156
  1. 6
      src/widget/multiselect/multiselect.loader.js

6
src/widget/multiselect/multiselect.loader.js

@ -70,7 +70,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
if (self.storeValue) {
var json = BI.map(self.storeValue.value.slice((op.times - 1) * 10, op.times * 10), function (i, v) {
var json = BI.map(self.storeValue.value.slice((op.times - 1) * 100, op.times * 100), function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
@ -90,7 +90,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
});
}
}
if (op.times < Math.floor((self.storeValue.value.length - 1) / 10)) {
if (op.times < Math.floor((self.storeValue.value.length - 1) / 100)) {
hasNext = true;
callback(self._createItems(json), op.keyword || "");
(op.times === 1) && self._scrollToTop();
@ -98,7 +98,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
}
firstItems = self._createItems(json);
}
var times = op.times - Math.max(0, Math.floor((self.storeValue.value.length - 1) / 10));
var times = op.times - Math.max(0, Math.floor((self.storeValue.value.length - 1) / 100));
opts.itemsCreator(BI.extend({}, op, {
times: times
}), function (ob) {

Loading…
Cancel
Save