From 7d42a339fd6b6765d755f59754ab3d47d2b3531d Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 17 May 2017 11:31:12 +0800 Subject: [PATCH] add --- bi/base.js | 12 ++++++++---- bi/core.js | 2 +- docs/base.js | 12 ++++++++---- docs/core.js | 2 +- src/base/collection/collection.js | 6 ++++-- src/base/grid/grid.js | 6 ++++-- src/core/wrapper/layout/layout.card.js | 2 +- 7 files changed, 27 insertions(+), 15 deletions(-) diff --git a/bi/base.js b/bi/base.js index b9e75adb9..e65c5645f 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 8baacfade..ef35ce451 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 b9e75adb9..e65c5645f 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 89d8d30f3..ff511e204 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 42a48ed83..111c833e8 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 34eb81aa8..82e00bad6 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 201b3ccbf..0a8447cad 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) {