Browse Source

chore: 优化

es6
guy 2 years ago
parent
commit
8cc5ed0199
  1. 7
      src/base/list/virtualgrouplist.js

7
src/base/list/virtualgrouplist.js

@ -27,7 +27,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.vertical", type: "bi.vertical",
items: [{ items: [{
@ -97,12 +97,13 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
this.container[self.renderedIndex === -1 ? "populate" : "addItems"](items.map(function (item, i) { this.container[self.renderedIndex === -1 ? "populate" : "addItems"](items.map(function (item, i) {
return o.itemFormatter(item, index + i); return o.itemFormatter(item, index + i);
}), this); }), this);
var addedHeight = getElementHeight() - lastHeight; var elementHeight = getElementHeight();
var addedHeight = elementHeight - lastHeight;
this.tree.set(cnt, addedHeight); this.tree.set(cnt, addedHeight);
this.renderedIndex = cnt; this.renderedIndex = cnt;
cnt++; cnt++;
index += o.blockSize; index += o.blockSize;
lastHeight = this.renderedIndex === -1 ? 0 : getElementHeight(); lastHeight = this.renderedIndex === -1 ? 0 : elementHeight;
} }
}, },

Loading…
Cancel
Save