Browse Source

BI-115516: 第一页多显示一些

es6
guy 2 years ago
parent
commit
4f18cc8cfa
  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; return false;
} }
this.options.items = (items || []).slice(0, 100); this.options.items = (items || []).slice(0, (items || []).length % 100);
this.times = 1; this.times = 1;
this.count = 0; this.count = 0;
this.count += items.length; this.count += items.length;
@ -184,14 +184,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
populate: function (items, keyword) { populate: function (items, keyword) {
if (this._populate.apply(this, arguments)) { if (this._populate.apply(this, arguments)) {
this.cachItems = []; this.cachItems = [];
if (items.length > 100) { var firstItemsCount = 100 + items.length % 100;
this.cachItems = items.slice(100); if (items.length > firstItemsCount) {
this.cachItems = items.slice(firstItemsCount);
} }
var renderEngine = BI.Widget._renderEngine; var renderEngine = BI.Widget._renderEngine;
BI.Widget.registerRenderEngine(BI.Element.renderEngine); BI.Widget.registerRenderEngine(BI.Element.renderEngine);
this.cachGroup.populate.call(this.cachGroup, items, keyword); this.cachGroup.populate.call(this.cachGroup, items, keyword);
BI.Widget.registerRenderEngine(renderEngine); 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