From 03bbac1322b37b716b93bbd5ed421486f47a0a62 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 18 May 2017 14:18:41 +0800 Subject: [PATCH] bug --- bi/base.js | 10 ++++++---- docs/base.js | 10 ++++++---- src/base/collection/collection.js | 5 +++-- src/base/grid/grid.js | 5 +++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bi/base.js b/bi/base.js index 89aeb00e72..cc94118cc6 100644 --- a/bi/base.js +++ b/bi/base.js @@ -2666,6 +2666,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { for (var i = 0, len = childrenToDisplay.length; i < len; i++) { var datum = childrenToDisplay[i]; var index = BI.deepIndexOf(this.renderedKeys, datum.index); + var child; if (index > -1) { if (datum.width !== this.renderedCells[index]._width) { this.renderedCells[index]._width = datum.width; @@ -2681,9 +2682,9 @@ BI.CollectionView = BI.inherit(BI.Widget, { if (this.renderedCells[index].top !== datum.y) { this.renderedCells[index].el.element.css("top", datum.y + "px"); } - renderedCells.push(this.renderedCells[index]); + renderedCells.push(child = this.renderedCells[index]); } else { - var child = BI.createWidget(BI.extend({ + child = BI.createWidget(BI.extend({ type: "bi.label", width: datum.width, height: datum.height @@ -14766,6 +14767,7 @@ BI.GridView = BI.inherit(BI.Widget, { var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex); var index = BI.deepIndexOf(this.renderedKeys, key); + var child; if (index > -1) { if (columnDatum.size !== this.renderedCells[index]._width) { this.renderedCells[index]._width = columnDatum.size; @@ -14781,9 +14783,9 @@ BI.GridView = BI.inherit(BI.Widget, { if (this.renderedCells[index].top !== rowDatum.offset + verticalOffsetAdjustment) { this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px"); } - renderedCells.push(this.renderedCells[index]); + renderedCells.push(child = this.renderedCells[index]); } else { - var child = BI.createWidget(BI.extend({ + child = BI.createWidget(BI.extend({ type: "bi.label", width: columnDatum.size, height: rowDatum.size diff --git a/docs/base.js b/docs/base.js index 89aeb00e72..cc94118cc6 100644 --- a/docs/base.js +++ b/docs/base.js @@ -2666,6 +2666,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { for (var i = 0, len = childrenToDisplay.length; i < len; i++) { var datum = childrenToDisplay[i]; var index = BI.deepIndexOf(this.renderedKeys, datum.index); + var child; if (index > -1) { if (datum.width !== this.renderedCells[index]._width) { this.renderedCells[index]._width = datum.width; @@ -2681,9 +2682,9 @@ BI.CollectionView = BI.inherit(BI.Widget, { if (this.renderedCells[index].top !== datum.y) { this.renderedCells[index].el.element.css("top", datum.y + "px"); } - renderedCells.push(this.renderedCells[index]); + renderedCells.push(child = this.renderedCells[index]); } else { - var child = BI.createWidget(BI.extend({ + child = BI.createWidget(BI.extend({ type: "bi.label", width: datum.width, height: datum.height @@ -14766,6 +14767,7 @@ BI.GridView = BI.inherit(BI.Widget, { var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex); var index = BI.deepIndexOf(this.renderedKeys, key); + var child; if (index > -1) { if (columnDatum.size !== this.renderedCells[index]._width) { this.renderedCells[index]._width = columnDatum.size; @@ -14781,9 +14783,9 @@ BI.GridView = BI.inherit(BI.Widget, { if (this.renderedCells[index].top !== rowDatum.offset + verticalOffsetAdjustment) { this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px"); } - renderedCells.push(this.renderedCells[index]); + renderedCells.push(child = this.renderedCells[index]); } else { - var child = BI.createWidget(BI.extend({ + child = BI.createWidget(BI.extend({ type: "bi.label", width: columnDatum.size, height: rowDatum.size diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 111c833e88..864a791026 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -156,6 +156,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { for (var i = 0, len = childrenToDisplay.length; i < len; i++) { var datum = childrenToDisplay[i]; var index = BI.deepIndexOf(this.renderedKeys, datum.index); + var child; if (index > -1) { if (datum.width !== this.renderedCells[index]._width) { this.renderedCells[index]._width = datum.width; @@ -171,9 +172,9 @@ BI.CollectionView = BI.inherit(BI.Widget, { if (this.renderedCells[index].top !== datum.y) { this.renderedCells[index].el.element.css("top", datum.y + "px"); } - renderedCells.push(this.renderedCells[index]); + renderedCells.push(child = this.renderedCells[index]); } else { - var child = BI.createWidget(BI.extend({ + child = BI.createWidget(BI.extend({ type: "bi.label", width: datum.width, height: datum.height diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index 35ccab50ca..56b65d42be 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -131,6 +131,7 @@ BI.GridView = BI.inherit(BI.Widget, { var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex); var index = BI.deepIndexOf(this.renderedKeys, key); + var child; if (index > -1) { if (columnDatum.size !== this.renderedCells[index]._width) { this.renderedCells[index]._width = columnDatum.size; @@ -146,9 +147,9 @@ BI.GridView = BI.inherit(BI.Widget, { if (this.renderedCells[index].top !== rowDatum.offset + verticalOffsetAdjustment) { this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px"); } - renderedCells.push(this.renderedCells[index]); + renderedCells.push(child = this.renderedCells[index]); } else { - var child = BI.createWidget(BI.extend({ + child = BI.createWidget(BI.extend({ type: "bi.label", width: columnDatum.size, height: rowDatum.size