diff --git a/bi/widget.js b/bi/widget.js index a6644c57af..a95f1d0f01 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -1045,7 +1045,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -1778,7 +1778,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); } diff --git a/dist/bundle.js b/dist/bundle.js index 18d6f644fe..029f202c12 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -76087,7 +76087,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -76820,7 +76820,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); } diff --git a/dist/widget.js b/dist/widget.js index a6644c57af..a95f1d0f01 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -1045,7 +1045,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -1778,7 +1778,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); } diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index 5105990914..fc7d71d2f3 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -298,7 +298,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { element: this.container }); } - this.wrapper.populate(items); + this.wrapper.addItems(items); }, getClientWidth: function () { @@ -1031,7 +1031,17 @@ BI.Arrangement = BI.inherit(BI.Widget, { }, populate: function (items) { - this.regions = {}; + // this.regions = {}; + var self = this; + BI.each(this.regions, function (name, region) { + var exist = BI.some(items, function (i, item) { + return item.el.attr("id") === name; + }); + if (!exist) { + self.regions[name].el.setVisible(false); + } + delete self.regions[name]; + }); this._populate(items); this._renderRegion(); }