Browse Source

Pull request #259421: BI-142531 fix: 缓存清空且hasNext为false时仍然显示加载更多数据

Merge in DEC/fineui from ~ZOEY.CHEN/fineui_:final/11.0 to final/11.0

* commit '9384119477626309ce958cbacb065fe5f665574c':
  BI-142531 fix: 缓存清空且hasNext为false时仍然显示加载更多数据
research/test
Zoey.Chen-陈泽语 11 months ago
parent
commit
40d5174afb
  1. 10
      packages/fineui/src/widget/multiselect/loader.js

10
packages/fineui/src/widget/multiselect/loader.js

@ -73,14 +73,14 @@ export class MultiSelectInnerLoader extends Widget {
if (this.cachItems && this.cachItems.length > 0) {
this.next.setLoaded();
const items = this._composeItems(this.cachItems.slice(0, 100));
this.addItems(items);
this.cachItems = this.cachItems.slice(100);
this.addItems(items);
return;
}
o.itemsCreator.apply(this, [
{ times: ++this.times },
function() {
function () {
self.next.setLoaded();
self.addItems(...arguments);
}
@ -105,7 +105,7 @@ export class MultiSelectInnerLoader extends Widget {
],
value: o.value,
});
this.button_group.on(Controller.EVENT_CHANGE, function(type, value, obj) {
this.button_group.on(Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === Events.CLICK) {
const node = self.cachGroup.getNodeByValue(value);
if (node) {
@ -160,7 +160,7 @@ export class MultiSelectInnerLoader extends Widget {
o.isDefaultInit &&
isEmpty(o.items) &&
nextTick(
bind(function() {
bind(function () {
o.isDefaultInit && isEmpty(o.items) && this._populate();
}, this)
);
@ -221,7 +221,7 @@ export class MultiSelectInnerLoader extends Widget {
if (arguments.length === 0 && isFunction(o.itemsCreator)) {
o.itemsCreator.apply(this, [
{ times: 1 },
function(items, keyword) {
function (items, keyword) {
if (arguments.length === 0) {
throw new Error("object already registered");
}

Loading…
Cancel
Save