Browse Source

Merge pull request #200450 in DEC/fineui from master to feature/x

* commit '7a2cd929b9d004b076f8bfe9e20bb45c363a5668':
  BI-115516 check面板也处理下
research/test
superman 2 years ago
parent
commit
ccd8bc9a28
  1. 22
      src/widget/multiselect/check/multiselect.display.js

22
src/widget/multiselect/check/multiselect.display.js

@ -26,6 +26,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.hasNext = false; this.hasNext = false;
var cacheItems = [];
this.button_group = BI.createWidget({ this.button_group = BI.createWidget({
type: "bi.list_pane", type: "bi.list_pane",
@ -45,10 +46,29 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
}] }]
}, },
itemsCreator: function (options, callback) { itemsCreator: function (options, callback) {
if (options.times === 1) {
cacheItems = [];
}
if (cacheItems.length > 0) {
var renderedItems = cacheItems.slice(0, 100);
cacheItems = cacheItems.slice(100);
self.hasNext = true;
if (cacheItems.length === 0) {
self.hasNext = false;
}
callback(self._createItems(renderedItems));
return;
}
opts.itemsCreator(options, function (ob) { opts.itemsCreator(options, function (ob) {
self.hasNext = !!ob.hasNext; self.hasNext = !!ob.hasNext;
callback(self._createItems(ob.items)); var firstItemsCount = 100 + ob.items.length % 100;
if (ob.items.length > 100) {
cacheItems = ob.items.slice(100 + ob.items.length % 100);
self.hasNext = true;
}
callback(self._createItems(ob.items.slice(0, firstItemsCount)));
}); });
}, },
hasNext: function () { hasNext: function () {

Loading…
Cancel
Save