Browse Source

无JIRA任务 grid布局populate空数组问题

master
young 8 years ago
parent
commit
d7cf76b6eb
  1. 5
      bi/base.js
  2. 5
      docs/base.js
  3. 5
      src/base/grid/grid.js

5
bi/base.js

@ -14750,6 +14750,10 @@ BI.Grid = BI.inherit(BI.Widget, {
if (o.items.length > 0) { if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; this.rowCount = o.items.length;
} else {
this.rowCount = 0;
this.columnCount = 0;
}
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -14759,7 +14763,6 @@ BI.Grid = BI.inherit(BI.Widget, {
this._calculateChildrenToRender(); this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop); this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft); this.element.scrollLeft(o.scrollLeft);
}
}, },
setScrollLeft: function (scrollLeft) { setScrollLeft: function (scrollLeft) {

5
docs/base.js

@ -14750,6 +14750,10 @@ BI.Grid = BI.inherit(BI.Widget, {
if (o.items.length > 0) { if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; this.rowCount = o.items.length;
} else {
this.rowCount = 0;
this.columnCount = 0;
}
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -14759,7 +14763,6 @@ BI.Grid = BI.inherit(BI.Widget, {
this._calculateChildrenToRender(); this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop); this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft); this.element.scrollLeft(o.scrollLeft);
}
}, },
setScrollLeft: function (scrollLeft) { setScrollLeft: function (scrollLeft) {

5
src/base/grid/grid.js

@ -195,6 +195,10 @@ BI.Grid = BI.inherit(BI.Widget, {
if (o.items.length > 0) { if (o.items.length > 0) {
this.columnCount = o.items[0].length; this.columnCount = o.items[0].length;
this.rowCount = o.items.length; this.rowCount = o.items.length;
} else {
this.rowCount = 0;
this.columnCount = 0;
}
this.container.setWidth(this.columnCount * o.estimatedColumnSize); this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize); this.container.setHeight(this.rowCount * o.estimatedRowSize);
@ -204,7 +208,6 @@ BI.Grid = BI.inherit(BI.Widget, {
this._calculateChildrenToRender(); this._calculateChildrenToRender();
this.element.scrollTop(o.scrollTop); this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft); this.element.scrollLeft(o.scrollLeft);
}
}, },
setScrollLeft: function (scrollLeft) { setScrollLeft: function (scrollLeft) {

Loading…
Cancel
Save