From aa987b66da5ea0367f37e1db8df530a63cb2ae6b Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 28 Jun 2023 11:15:12 +0800 Subject: [PATCH] =?UTF-8?q?BI-128988=20fix:=20=E3=80=90=E6=9D=A5=E6=BA=90P?= =?UTF-8?q?T=E9=A1=B9=E7=9B=AE=E3=80=91=E6=96=87=E6=9C=AC=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=BB=84=E4=BB=B6=E6=96=87=E6=9C=AC=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8=20-=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 3ea50472f..0101d8908 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -158,6 +158,11 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { this.next.setEnd(); } } + // cacheGroup渲染的是全量的,如果这次加载更多add的items是从cacheItems里面拿的,那不用再add了 + if (this.cachItems.length > 0) { + this.button_group.addItems(...arguments); + return; + } var renderEngine = BI.Widget._renderEngine; BI.Widget.registerRenderEngine(BI.Element.renderEngine); this.cachGroup.addItems.apply(this.cachGroup, arguments); @@ -183,13 +188,6 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { this.times = 1; this.count = 0; this.count += items.length; - if (BI.isObject(this.next)) { - if (this.hasNext()) { - this.next.setLoaded(); - } else { - this.next.invisible(); - } - } return true; }, @@ -205,6 +203,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { this.cachGroup.populate.call(this.cachGroup, items, keyword); BI.Widget.registerRenderEngine(renderEngine); this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword); + + // hasNext依赖的是cacheItems计算,所以从_populate挪到populate里面 + if (BI.isObject(this.next)) { + if (this.hasNext()) { + this.next.setLoaded(); + } else { + this.next.invisible(); + } + } } },