From 4f18cc8cfa1a402e30ed4e270078130998362a5f Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 11:00:46 +0800 Subject: [PATCH] =?UTF-8?q?BI-115516:=20=E7=AC=AC=E4=B8=80=E9=A1=B5?= =?UTF-8?q?=E5=A4=9A=E6=98=BE=E7=A4=BA=E4=B8=80=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 47f34a729..7f4a293de 100644 --- a/src/widget/multiselect/loader.js +++ b/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); } },