diff --git a/bi/base.js b/bi/base.js index 0077aef3b..fc4d817c4 100644 --- a/bi/base.js +++ b/bi/base.js @@ -14750,16 +14750,19 @@ BI.Grid = BI.inherit(BI.Widget, { if (o.items.length > 0) { this.columnCount = o.items[0].length; this.rowCount = o.items.length; - this.container.setWidth(this.columnCount * o.estimatedColumnSize); - this.container.setHeight(this.rowCount * o.estimatedRowSize); + } else { + this.rowCount = 0; + this.columnCount = 0; + } + this.container.setWidth(this.columnCount * o.estimatedColumnSize); + this.container.setHeight(this.rowCount * o.estimatedRowSize); - this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); - this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); + this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); + this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); - this._calculateChildrenToRender(); - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); - } + this._calculateChildrenToRender(); + this.element.scrollTop(o.scrollTop); + this.element.scrollLeft(o.scrollLeft); }, setScrollLeft: function (scrollLeft) { diff --git a/docs/base.js b/docs/base.js index 0077aef3b..fc4d817c4 100644 --- a/docs/base.js +++ b/docs/base.js @@ -14750,16 +14750,19 @@ BI.Grid = BI.inherit(BI.Widget, { if (o.items.length > 0) { this.columnCount = o.items[0].length; this.rowCount = o.items.length; - this.container.setWidth(this.columnCount * o.estimatedColumnSize); - this.container.setHeight(this.rowCount * o.estimatedRowSize); + } else { + this.rowCount = 0; + this.columnCount = 0; + } + this.container.setWidth(this.columnCount * o.estimatedColumnSize); + this.container.setHeight(this.rowCount * o.estimatedRowSize); - this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); - this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); + this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); + this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); - this._calculateChildrenToRender(); - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); - } + this._calculateChildrenToRender(); + this.element.scrollTop(o.scrollTop); + this.element.scrollLeft(o.scrollLeft); }, setScrollLeft: function (scrollLeft) { diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index 21c96a0a5..fdce627c3 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -195,16 +195,19 @@ BI.Grid = BI.inherit(BI.Widget, { if (o.items.length > 0) { this.columnCount = o.items[0].length; this.rowCount = o.items.length; - this.container.setWidth(this.columnCount * o.estimatedColumnSize); - this.container.setHeight(this.rowCount * o.estimatedRowSize); + } else { + this.rowCount = 0; + this.columnCount = 0; + } + this.container.setWidth(this.columnCount * o.estimatedColumnSize); + this.container.setHeight(this.rowCount * o.estimatedRowSize); - this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); - this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); + this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize); + this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize); - this._calculateChildrenToRender(); - this.element.scrollTop(o.scrollTop); - this.element.scrollLeft(o.scrollLeft); - } + this._calculateChildrenToRender(); + this.element.scrollTop(o.scrollTop); + this.element.scrollLeft(o.scrollLeft); }, setScrollLeft: function (scrollLeft) {