guy 8 years ago
parent
commit
7d42a339fd
  1. 12
      bi/base.js
  2. 2
      bi/core.js
  3. 12
      docs/base.js
  4. 2
      docs/core.js
  5. 6
      src/base/collection/collection.js
  6. 6
      src/base/grid/grid.js
  7. 2
      src/core/wrapper/layout/layout.card.js

12
bi/base.js

@ -2639,7 +2639,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
return; return;
} }
var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top);
var renderedCells = [], renderedKeys = []; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
//存储所有的left和top //存储所有的left和top
var lefts = {}, tops = {}; var lefts = {}, tops = {};
for (var i = 0, len = childrenToDisplay.length; i < len; i++) { for (var i = 0, len = childrenToDisplay.length; i < len; i++) {
@ -2722,6 +2722,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
} }
renderedKeys.push(datum.index); renderedKeys.push(datum.index);
renderedWidgets[i] = child;
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = []; var existSet = {}, addSet = {}, deleteArray = [];
@ -2751,7 +2752,8 @@ BI.CollectionView = BI.inherit(BI.Widget, {
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
//拦截父子级关系 //拦截父子级关系
this.container._children = renderedCells; this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;
@ -14771,7 +14773,7 @@ BI.GridView = BI.inherit(BI.Widget, {
return; return;
} }
var renderedCells = [], renderedKeys = []; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
@ -14822,6 +14824,7 @@ BI.GridView = BI.inherit(BI.Widget, {
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys.push(key); renderedKeys.push(key);
renderedWidgets[i] = child;
} }
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
@ -14852,7 +14855,8 @@ BI.GridView = BI.inherit(BI.Widget, {
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
//拦截父子级关系 //拦截父子级关系
this.container._children = renderedCells; this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;
this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY}; this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY};

2
bi/core.js

@ -13043,7 +13043,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
var child = this._children[cardName]; var child = this._children[cardName];
this._deleteCardByName(cardName); this._deleteCardByName(cardName);
child && child.destroy(); child && child._destroy();
}, },
addCardByName: function (cardName, cardItem) { addCardByName: function (cardName, cardItem) {

12
docs/base.js

@ -2639,7 +2639,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
return; return;
} }
var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top);
var renderedCells = [], renderedKeys = []; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
//存储所有的left和top //存储所有的left和top
var lefts = {}, tops = {}; var lefts = {}, tops = {};
for (var i = 0, len = childrenToDisplay.length; i < len; i++) { for (var i = 0, len = childrenToDisplay.length; i < len; i++) {
@ -2722,6 +2722,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
} }
renderedKeys.push(datum.index); renderedKeys.push(datum.index);
renderedWidgets[i] = child;
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = []; var existSet = {}, addSet = {}, deleteArray = [];
@ -2751,7 +2752,8 @@ BI.CollectionView = BI.inherit(BI.Widget, {
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
//拦截父子级关系 //拦截父子级关系
this.container._children = renderedCells; this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;
@ -14771,7 +14773,7 @@ BI.GridView = BI.inherit(BI.Widget, {
return; return;
} }
var renderedCells = [], renderedKeys = []; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
@ -14822,6 +14824,7 @@ BI.GridView = BI.inherit(BI.Widget, {
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys.push(key); renderedKeys.push(key);
renderedWidgets[i] = child;
} }
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
@ -14852,7 +14855,8 @@ BI.GridView = BI.inherit(BI.Widget, {
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
//拦截父子级关系 //拦截父子级关系
this.container._children = renderedCells; this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;
this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY}; this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY};

2
docs/core.js

@ -26557,7 +26557,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
var child = this._children[cardName]; var child = this._children[cardName];
this._deleteCardByName(cardName); this._deleteCardByName(cardName);
child && child.destroy(); child && child._destroy();
}, },
addCardByName: function (cardName, cardItem) { addCardByName: function (cardName, cardItem) {

6
src/base/collection/collection.js

@ -127,7 +127,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
return; return;
} }
var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top); var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top);
var renderedCells = [], renderedKeys = []; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
//存储所有的left和top //存储所有的left和top
var lefts = {}, tops = {}; var lefts = {}, tops = {};
for (var i = 0, len = childrenToDisplay.length; i < len; i++) { for (var i = 0, len = childrenToDisplay.length; i < len; i++) {
@ -210,6 +210,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
} }
renderedKeys.push(datum.index); renderedKeys.push(datum.index);
renderedWidgets[i] = child;
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = []; var existSet = {}, addSet = {}, deleteArray = [];
@ -239,7 +240,8 @@ BI.CollectionView = BI.inherit(BI.Widget, {
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
//拦截父子级关系 //拦截父子级关系
this.container._children = renderedCells; this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;

6
src/base/grid/grid.js

@ -121,7 +121,7 @@ BI.GridView = BI.inherit(BI.Widget, {
return; return;
} }
var renderedCells = [], renderedKeys = []; var renderedCells = [], renderedKeys = [], renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0; var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) { for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex); var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
@ -172,6 +172,7 @@ BI.GridView = BI.inherit(BI.Widget, {
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment); minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size); maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys.push(key); renderedKeys.push(key);
renderedWidgets[i] = child;
} }
} }
//已存在的, 需要添加的和需要删除的 //已存在的, 需要添加的和需要删除的
@ -202,7 +203,8 @@ BI.GridView = BI.inherit(BI.Widget, {
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
//拦截父子级关系 //拦截父子级关系
this.container._children = renderedCells; this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells; this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys; this.renderedKeys = renderedKeys;
this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY}; this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY};

2
src/core/wrapper/layout/layout.card.js

@ -91,7 +91,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
var child = this._children[cardName]; var child = this._children[cardName];
this._deleteCardByName(cardName); this._deleteCardByName(cardName);
child && child.destroy(); child && child._destroy();
}, },
addCardByName: function (cardName, cardItem) { addCardByName: function (cardName, cardItem) {

Loading…
Cancel
Save