diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 6ef7ed813..09b8f9de0 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -156,7 +156,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { border[offset] = 0; } }; - var lastDatum = BI.last(BI.sortBy(childrenToDisplay, function (index, child) { + var lastDatum = BI.last(BI.sortBy(this._sectionManager.getAllCellMetadata(), function (index, child) { return (child.x + child.width + child.y + child.height); })); for (var i = 0, len = childrenToDisplay.length; i < len; i++) { diff --git a/src/core/structure/sectionManager.js b/src/core/structure/sectionManager.js index ee0692072..314fbb4ab 100644 --- a/src/core/structure/sectionManager.js +++ b/src/core/structure/sectionManager.js @@ -46,6 +46,10 @@ }); }, + getAllCellMetadata: function () { + return this._cellMetadata; + }, + getCellMetadata: function (index) { return this._cellMetadata[index]; },