|
|
@ -25,6 +25,7 @@ export class VirtualGroupList extends Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
init() { |
|
|
|
init() { |
|
|
|
|
|
|
|
this._calculateSummaryHeight(); |
|
|
|
this.renderedIndex = -1; |
|
|
|
this.renderedIndex = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -44,7 +45,7 @@ export class VirtualGroupList extends Widget { |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: VirtualGroup.xtype, |
|
|
|
type: VirtualGroup.xtype, |
|
|
|
height: rowHeight * items.length, |
|
|
|
height: this.summaryHeight, |
|
|
|
ref: (ref) => { |
|
|
|
ref: (ref) => { |
|
|
|
this.container = ref; |
|
|
|
this.container = ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -169,6 +170,16 @@ export class VirtualGroupList extends Widget { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_calculateSummaryHeight() { |
|
|
|
|
|
|
|
const o = this.options; |
|
|
|
|
|
|
|
if (isFunction(o.rowHeight)) { |
|
|
|
|
|
|
|
this.summaryHeight = sum(o.items, o.rowHeight); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_populate(items) { |
|
|
|
_populate(items) { |
|
|
|
const { blockSize, rowHeight, scrollTop } = this.options; |
|
|
|
const { blockSize, rowHeight, scrollTop } = this.options; |
|
|
|
if (items && this.options.items !== items) { |
|
|
|
if (items && this.options.items !== items) { |
|
|
@ -198,13 +209,8 @@ export class VirtualGroupList extends Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_restore() { |
|
|
|
_restore() { |
|
|
|
const o = this.options; |
|
|
|
|
|
|
|
this.renderedIndex = -1; |
|
|
|
this.renderedIndex = -1; |
|
|
|
if (isFunction(o.rowHeight)) { |
|
|
|
this._calculateSummaryHeight(); |
|
|
|
this.summaryHeight = sum(o.items, o.rowHeight); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.summaryHeight = this._isAutoHeight() ? 0 : o.rowHeight * o.items.length; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 依赖于cache的占位元素也要初始化
|
|
|
|
// 依赖于cache的占位元素也要初始化
|
|
|
|
this.topBlank.setHeight(0); |
|
|
|
this.topBlank.setHeight(0); |
|
|
|
this.bottomBlank.setHeight(0); |
|
|
|
this.bottomBlank.setHeight(0); |
|
|
|