diff --git a/bi/base.js b/bi/base.js index ba2bebf1c..e8dcccdbe 100644 --- a/bi/base.js +++ b/bi/base.js @@ -2850,10 +2850,16 @@ BI.CollectionView = BI.inherit(BI.Widget, { this.renderRange = {}; }, + _clearChildren: function () { + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + cell.el._destroy(); }); + this._clearChildren(); this.renderedCells = []; this.renderedKeys = []; this.renderRange = {}; @@ -2864,6 +2870,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { if (items && items !== this.options.items) { this.options.items = items; this._calculateSizeAndPositionData(); + this.restore(); } this._populate(); } @@ -14953,10 +14960,16 @@ BI.GridView = BI.inherit(BI.Widget, { this.renderRange = {}; }, + _clearChildren: function () { + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + cell.el._destroy(); }); + this._clearChildren(); this.renderedCells = []; this.renderedKeys = []; this.renderRange = {}; @@ -14966,6 +14979,7 @@ BI.GridView = BI.inherit(BI.Widget, { populate: function (items) { if (items && items !== this.options.items) { this.options.items = items; + this.restore(); } this._populate(); } diff --git a/docs/base.js b/docs/base.js index ba2bebf1c..e8dcccdbe 100644 --- a/docs/base.js +++ b/docs/base.js @@ -2850,10 +2850,16 @@ BI.CollectionView = BI.inherit(BI.Widget, { this.renderRange = {}; }, + _clearChildren: function () { + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + cell.el._destroy(); }); + this._clearChildren(); this.renderedCells = []; this.renderedKeys = []; this.renderRange = {}; @@ -2864,6 +2870,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { if (items && items !== this.options.items) { this.options.items = items; this._calculateSizeAndPositionData(); + this.restore(); } this._populate(); } @@ -14953,10 +14960,16 @@ BI.GridView = BI.inherit(BI.Widget, { this.renderRange = {}; }, + _clearChildren: function () { + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + cell.el._destroy(); }); + this._clearChildren(); this.renderedCells = []; this.renderedKeys = []; this.renderRange = {}; @@ -14966,6 +14979,7 @@ BI.GridView = BI.inherit(BI.Widget, { populate: function (items) { if (items && items !== this.options.items) { this.options.items = items; + this.restore(); } this._populate(); } diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index a4ee2e3d3..52acf1434 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -340,10 +340,16 @@ BI.CollectionView = BI.inherit(BI.Widget, { this.renderRange = {}; }, + _clearChildren: function () { + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + cell.el._destroy(); }); + this._clearChildren(); this.renderedCells = []; this.renderedKeys = []; this.renderRange = {}; @@ -354,6 +360,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { if (items && items !== this.options.items) { this.options.items = items; this._calculateSizeAndPositionData(); + this.restore(); } this._populate(); } diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index 98bd8d3b2..4d79401c8 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -312,10 +312,16 @@ BI.GridView = BI.inherit(BI.Widget, { this.renderRange = {}; }, + _clearChildren: function () { + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); + cell.el._destroy(); }); + this._clearChildren(); this.renderedCells = []; this.renderedKeys = []; this.renderRange = {}; @@ -325,6 +331,7 @@ BI.GridView = BI.inherit(BI.Widget, { populate: function (items) { if (items && items !== this.options.items) { this.options.items = items; + this.restore(); } this._populate(); }