Browse Source

Pull request #3134: BI-115516: 第一页多显示一些

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '6e1dbea482dafa03f9ae2bccc945a3adec9ac17b':
  BI-115516: 第一页多显示一些
es6
guy-王川 2 years ago
parent
commit
9bdc3080be
  1. 9
      src/widget/multiselect/loader.js

9
src/widget/multiselect/loader.js

@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
}]);
return false;
}
this.options.items = (items || []).slice(0, 100);
this.options.items = (items || []).slice(0, (items || []).length % 100);
this.times = 1;
this.count = 0;
this.count += items.length;
@ -184,14 +184,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
populate: function (items, keyword) {
if (this._populate.apply(this, arguments)) {
this.cachItems = [];
if (items.length > 100) {
this.cachItems = items.slice(100);
var firstItemsCount = 100 + items.length % 100;
if (items.length > firstItemsCount) {
this.cachItems = items.slice(firstItemsCount);
}
var renderEngine = BI.Widget._renderEngine;
BI.Widget.registerRenderEngine(BI.Element.renderEngine);
this.cachGroup.populate.call(this.cachGroup, items, keyword);
BI.Widget.registerRenderEngine(renderEngine);
this.button_group.populate.call(this.button_group, items.slice(0, 100), keyword);
this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword);
}
},

Loading…
Cancel
Save