diff --git a/bi/base.js b/bi/base.js index b9e75adb9a..e65c5645fe 100644 --- a/bi/base.js +++ b/bi/base.js @@ -2639,7 +2639,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { return; } var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); - var renderedCells = [], renderedKeys = []; + var renderedCells = [], renderedKeys = [], renderedWidgets = {}; //存储所有的left和top var lefts = {}, tops = {}; for (var i = 0, len = childrenToDisplay.length; i < len; i++) { @@ -2722,6 +2722,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { } renderedKeys.push(datum.index); + renderedWidgets[i] = child; } //已存在的, 需要添加的和需要删除的 var existSet = {}, addSet = {}, deleteArray = []; @@ -2751,7 +2752,8 @@ BI.CollectionView = BI.inherit(BI.Widget, { }); this.container.addItems(addedItems); //拦截父子级关系 - this.container._children = renderedCells; + this.container._children = renderedWidgets; + this.container.attr("items", renderedCells); this.renderedCells = renderedCells; this.renderedKeys = renderedKeys; @@ -14771,7 +14773,7 @@ BI.GridView = BI.inherit(BI.Widget, { return; } - var renderedCells = [], renderedKeys = []; + var renderedCells = [], renderedKeys = [], renderedWidgets = {}; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); @@ -14822,6 +14824,7 @@ BI.GridView = BI.inherit(BI.Widget, { minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); renderedKeys.push(key); + renderedWidgets[i] = child; } } //已存在的, 需要添加的和需要删除的 @@ -14852,7 +14855,8 @@ BI.GridView = BI.inherit(BI.Widget, { }); this.container.addItems(addedItems); //拦截父子级关系 - this.container._children = renderedCells; + this.container._children = renderedWidgets; + this.container.attr("items", renderedCells); this.renderedCells = renderedCells; this.renderedKeys = renderedKeys; this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY}; diff --git a/bi/core.js b/bi/core.js index 8baacfadef..ef35ce4519 100644 --- a/bi/core.js +++ b/bi/core.js @@ -13043,7 +13043,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { var child = this._children[cardName]; this._deleteCardByName(cardName); - child && child.destroy(); + child && child._destroy(); }, addCardByName: function (cardName, cardItem) { diff --git a/docs/base.js b/docs/base.js index b9e75adb9a..e65c5645fe 100644 --- a/docs/base.js +++ b/docs/base.js @@ -2639,7 +2639,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { return; } var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); - var renderedCells = [], renderedKeys = []; + var renderedCells = [], renderedKeys = [], renderedWidgets = {}; //存储所有的left和top var lefts = {}, tops = {}; for (var i = 0, len = childrenToDisplay.length; i < len; i++) { @@ -2722,6 +2722,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { } renderedKeys.push(datum.index); + renderedWidgets[i] = child; } //已存在的, 需要添加的和需要删除的 var existSet = {}, addSet = {}, deleteArray = []; @@ -2751,7 +2752,8 @@ BI.CollectionView = BI.inherit(BI.Widget, { }); this.container.addItems(addedItems); //拦截父子级关系 - this.container._children = renderedCells; + this.container._children = renderedWidgets; + this.container.attr("items", renderedCells); this.renderedCells = renderedCells; this.renderedKeys = renderedKeys; @@ -14771,7 +14773,7 @@ BI.GridView = BI.inherit(BI.Widget, { return; } - var renderedCells = [], renderedKeys = []; + var renderedCells = [], renderedKeys = [], renderedWidgets = {}; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); @@ -14822,6 +14824,7 @@ BI.GridView = BI.inherit(BI.Widget, { minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); renderedKeys.push(key); + renderedWidgets[i] = child; } } //已存在的, 需要添加的和需要删除的 @@ -14852,7 +14855,8 @@ BI.GridView = BI.inherit(BI.Widget, { }); this.container.addItems(addedItems); //拦截父子级关系 - this.container._children = renderedCells; + this.container._children = renderedWidgets; + this.container.attr("items", renderedCells); this.renderedCells = renderedCells; this.renderedKeys = renderedKeys; this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY}; diff --git a/docs/core.js b/docs/core.js index 89d8d30f36..ff511e2044 100644 --- a/docs/core.js +++ b/docs/core.js @@ -26557,7 +26557,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { var child = this._children[cardName]; this._deleteCardByName(cardName); - child && child.destroy(); + child && child._destroy(); }, addCardByName: function (cardName, cardItem) { diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 42a48ed83e..111c833e88 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -127,7 +127,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { return; } var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); - var renderedCells = [], renderedKeys = []; + var renderedCells = [], renderedKeys = [], renderedWidgets = {}; //存储所有的left和top var lefts = {}, tops = {}; for (var i = 0, len = childrenToDisplay.length; i < len; i++) { @@ -210,6 +210,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { } renderedKeys.push(datum.index); + renderedWidgets[i] = child; } //已存在的, 需要添加的和需要删除的 var existSet = {}, addSet = {}, deleteArray = []; @@ -239,7 +240,8 @@ BI.CollectionView = BI.inherit(BI.Widget, { }); this.container.addItems(addedItems); //拦截父子级关系 - this.container._children = renderedCells; + this.container._children = renderedWidgets; + this.container.attr("items", renderedCells); this.renderedCells = renderedCells; this.renderedKeys = renderedKeys; diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index 34eb81aa88..82e00bad64 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -121,7 +121,7 @@ BI.GridView = BI.inherit(BI.Widget, { return; } - var renderedCells = [], renderedKeys = []; + var renderedCells = [], renderedKeys = [], renderedWidgets = {}; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); @@ -172,6 +172,7 @@ BI.GridView = BI.inherit(BI.Widget, { minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); renderedKeys.push(key); + renderedWidgets[i] = child; } } //已存在的, 需要添加的和需要删除的 @@ -202,7 +203,8 @@ BI.GridView = BI.inherit(BI.Widget, { }); this.container.addItems(addedItems); //拦截父子级关系 - this.container._children = renderedCells; + this.container._children = renderedWidgets; + this.container.attr("items", renderedCells); this.renderedCells = renderedCells; this.renderedKeys = renderedKeys; this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY}; diff --git a/src/core/wrapper/layout/layout.card.js b/src/core/wrapper/layout/layout.card.js index 201b3ccbf6..0a8447cadf 100644 --- a/src/core/wrapper/layout/layout.card.js +++ b/src/core/wrapper/layout/layout.card.js @@ -91,7 +91,7 @@ BI.CardLayout = BI.inherit(BI.Layout, { var child = this._children[cardName]; this._deleteCardByName(cardName); - child && child.destroy(); + child && child._destroy(); }, addCardByName: function (cardName, cardItem) {