|
|
|
@ -13,7 +13,10 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
|
|
|
|
|
blockSize: 10, |
|
|
|
|
scrollTop: 0, |
|
|
|
|
rowHeight: "auto", |
|
|
|
|
items: [] |
|
|
|
|
items: [], |
|
|
|
|
itemFormatter: function (item, index) { |
|
|
|
|
return item; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -79,7 +82,9 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
|
|
|
|
|
}; |
|
|
|
|
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { |
|
|
|
|
var items = o.items.slice(index, index + o.blockSize); |
|
|
|
|
this.container.addItems(items, this); |
|
|
|
|
this.container.addItems(items.map(function (item, i) { |
|
|
|
|
return o.itemFormatter(item, index + i) |
|
|
|
|
}), this); |
|
|
|
|
var addedHeight = getElementHeight() - lastHeight; |
|
|
|
|
this.tree.set(cnt, addedHeight); |
|
|
|
|
this.renderedIndex = cnt; |
|
|
|
@ -107,7 +112,9 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); |
|
|
|
|
this.container.populate(items); |
|
|
|
|
this.container.populate(items.map(function (item, i) { |
|
|
|
|
return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i) |
|
|
|
|
})); |
|
|
|
|
} else { |
|
|
|
|
for (var i = (start < 0 ? 0 : start); i <= end; i++) { |
|
|
|
|
var index = i * o.blockSize; |
|
|
|
@ -116,7 +123,9 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.container.element.height(o.rowHeight * o.items.length - topHeight); |
|
|
|
|
this.container.populate(items); |
|
|
|
|
this.container.populate(items.map(function (item, i) { |
|
|
|
|
return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i) |
|
|
|
|
})); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|