Browse Source

Merge pull request #39097 in DEC/fineui from master to feature/x

* commit 'c8a00b910838b402bb4fac63eb87cf850d0960db':
  bugfix:没有可见的单元格可能之前就已经有渲染的了
es6
superman 3 years ago
parent
commit
e6484319ba
  1. 8
      src/base/grid/grid.js

8
src/base/grid/grid.js

@ -130,9 +130,9 @@ BI.GridView = BI.inherit(BI.Widget, {
var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft);
var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop);
if (BI.isEmpty(visibleColumnIndices) || BI.isEmpty(visibleRowIndices)) {
return;
}
var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
// 没有可见的单元格就干掉所有渲染过的
if (!BI.isEmpty(visibleColumnIndices) && !BI.isEmpty(visibleRowIndices)) {
var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft);
var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop);
@ -164,7 +164,6 @@ BI.GridView = BI.inherit(BI.Widget, {
return;
}
var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
@ -225,6 +224,7 @@ BI.GridView = BI.inherit(BI.Widget, {
count++;
}
}
}
// 已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = [];
BI.each(renderedKeys, function (i, key) {

Loading…
Cancel
Save