diff --git a/packages/fineui/src/widget/multiselect/loader.js b/packages/fineui/src/widget/multiselect/loader.js index db341ce95..f7146250f 100644 --- a/packages/fineui/src/widget/multiselect/loader.js +++ b/packages/fineui/src/widget/multiselect/loader.js @@ -72,7 +72,8 @@ export class MultiSelectInnerLoader extends Widget { this.next.setLoading(); if (this.cachItems && this.cachItems.length > 0) { this.next.setLoaded(); - this.addItems(this.cachItems.slice(0, 100)); + const items = this._composeItems(this.cachItems.slice(0, 100)); + this.addItems(items); this.cachItems = this.cachItems.slice(100); return; @@ -204,6 +205,16 @@ export class MultiSelectInnerLoader extends Widget { this.button_group.addItems(...arguments); } + _composeItems(items) { + const cacheValue = this.cachGroup.getValue(); + return items.map(item => { + return { + ...item, + selected: cacheValue.includes(item.value || item.id) + }; + }); + } + _populate(items) { const self = this, o = this.options;