Browse Source

Pull request #2705: 无JIRA任务 bugfix:没有可见的单元格可能之前就已经有渲染的了

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '7a3e66ae92e00fff14b4a5a1d22e97867f4f1e33':
  bugfix:没有可见的单元格可能之前就已经有渲染的了
es6
guy 3 years ago
parent
commit
c8a00b9108
  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