Browse Source

chore: 优化

es6
guy 2 years ago
parent
commit
956ff1ac44
  1. 9
      src/base/collection/collection.js
  2. 5
      src/base/grid/grid.js

9
src/base/collection/collection.js

@ -16,6 +16,9 @@ BI.CollectionView = BI.inherit(BI.Widget, {
scrolly: false,
overflowX: true,
overflowY: true,
el: {
type: "bi.vertical"
},
cellSizeAndPositionGetter: BI.emptyFn,
horizontalOverscanSize: 0,
verticalOverscanSize: 0,
@ -65,7 +68,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
scrollable = "x";
}
}
BI._lazyCreateWidget({
BI._lazyCreateWidget(o.el, {
type: "bi.vertical",
element: this,
scrollable: scrollable,
@ -124,7 +127,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
_cellRenderers: function (height, width, x, y) {
this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y);
return this._cellGroupRenderer();
},
@ -135,7 +138,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
var cellMetadata = self._sectionManager.getCellMetadata(index);
rendered.push(cellMetadata);
});
return rendered;
},

5
src/base/grid/grid.js

@ -16,6 +16,9 @@ BI.GridView = BI.inherit(BI.Widget, {
scrolly: false,
overflowX: true,
overflowY: true,
el: {
type: "bi.vertical"
},
overscanColumnCount: 0,
overscanRowCount: 0,
rowHeightGetter: BI.emptyFn, // number类型或function类型
@ -68,7 +71,7 @@ BI.GridView = BI.inherit(BI.Widget, {
scrollable = "x";
}
}
BI._lazyCreateWidget({
BI._lazyCreateWidget(o.el, {
type: "bi.vertical",
element: this,
scrollable: scrollable,

Loading…
Cancel
Save