|
|
@ -137,20 +137,20 @@ BI.GridView = BI.inherit(BI.Widget, { |
|
|
|
var index = this.renderedKeys[key] && this.renderedKeys[key][2]; |
|
|
|
var index = this.renderedKeys[key] && this.renderedKeys[key][2]; |
|
|
|
var child; |
|
|
|
var child; |
|
|
|
if (index >= 0) { |
|
|
|
if (index >= 0) { |
|
|
|
if (columnDatum.size !== this.renderedCells[index]._width) { |
|
|
|
// if (columnDatum.size !== this.renderedCells[index]._width) {
|
|
|
|
this.renderedCells[index]._width = columnDatum.size; |
|
|
|
// this.renderedCells[index]._width = columnDatum.size;
|
|
|
|
this.renderedCells[index].el.setWidth(columnDatum.size); |
|
|
|
this.renderedCells[index].el.setWidth(columnDatum.size); |
|
|
|
} |
|
|
|
// }
|
|
|
|
if (rowDatum.size !== this.renderedCells[index]._height) { |
|
|
|
// if (rowDatum.size !== this.renderedCells[index]._height) {
|
|
|
|
this.renderedCells[index]._height = rowDatum.size; |
|
|
|
// this.renderedCells[index]._height = rowDatum.size;
|
|
|
|
this.renderedCells[index].el.setHeight(rowDatum.size); |
|
|
|
this.renderedCells[index].el.setHeight(rowDatum.size); |
|
|
|
} |
|
|
|
// }
|
|
|
|
if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) { |
|
|
|
// if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) {
|
|
|
|
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); |
|
|
|
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); |
|
|
|
} |
|
|
|
// }
|
|
|
|
if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) { |
|
|
|
// if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) {
|
|
|
|
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); |
|
|
|
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); |
|
|
|
} |
|
|
|
// }
|
|
|
|
child = this.renderedCells[index].el; |
|
|
|
child = this.renderedCells[index].el; |
|
|
|
renderedCells.push(this.renderedCells[index]); |
|
|
|
renderedCells.push(this.renderedCells[index]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -171,8 +171,8 @@ BI.GridView = BI.inherit(BI.Widget, { |
|
|
|
top: rowDatum.offset + verticalOffsetAdjustment, |
|
|
|
top: rowDatum.offset + verticalOffsetAdjustment, |
|
|
|
_left: columnDatum.offset + horizontalOffsetAdjustment, |
|
|
|
_left: columnDatum.offset + horizontalOffsetAdjustment, |
|
|
|
_top: rowDatum.offset + verticalOffsetAdjustment, |
|
|
|
_top: rowDatum.offset + verticalOffsetAdjustment, |
|
|
|
_width: columnDatum.size, |
|
|
|
// _width: columnDatum.size,
|
|
|
|
_height: rowDatum.size |
|
|
|
// _height: rowDatum.size
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
minX = Math.min(minX, columnDatum.offset + horizontalOffsetAdjustment); |
|
|
|
minX = Math.min(minX, columnDatum.offset + horizontalOffsetAdjustment); |
|
|
@ -224,7 +224,7 @@ BI.GridView = BI.inherit(BI.Widget, { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取真实的可滚动的最大宽度 |
|
|
|
* 获取真实的可滚动的最大宽度 |
|
|
|
* 对于grid_view如果没有全部渲染过,this._columnSizeAndPositionManager.getTotalSize获取的宽度是不准确的 |
|
|
|
* 对于grid_view如果没有全部渲染过,this._columnSizeAndPositionManager.getTotalSize获取的宽度是不准确的 |
|
|
|
* 因此在调用setScrollLeft等函数时会造成没法移动到最右端(预估可移动具体太短) |
|
|
|
* 因此在调用setScrollLeft等函数时会造成没法移动到最右端(预估可移动距离太短) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
_getRealMaxScrollLeft: function () { |
|
|
|
_getRealMaxScrollLeft: function () { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
@ -267,6 +267,7 @@ BI.GridView = BI.inherit(BI.Widget, { |
|
|
|
this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); |
|
|
|
this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); |
|
|
|
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); |
|
|
|
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._debounceRelease(); |
|
|
|
this._calculateChildrenToRender(); |
|
|
|
this._calculateChildrenToRender(); |
|
|
|
// 元素未挂载时不能设置scrollTop
|
|
|
|
// 元素未挂载时不能设置scrollTop
|
|
|
|
try { |
|
|
|
try { |
|
|
|