|
|
@ -14842,10 +14842,10 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
return index + ""; |
|
|
|
return index + ""; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_addElement: function (i, item) { |
|
|
|
_addElement: function (i, item, context) { |
|
|
|
var self = this, w; |
|
|
|
var self = this, w; |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
w = BI.createWidget(item); |
|
|
|
w = BI.createWidget(item, context); |
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
BI.each(self._children, function (name, child) { |
|
|
|
BI.each(self._children, function (name, child) { |
|
|
|
if (child === w) { |
|
|
|
if (child === w) { |
|
|
@ -15052,12 +15052,12 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
w._mount(); |
|
|
|
w._mount(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
addItems: function (items) { |
|
|
|
addItems: function (items, context) { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var fragment = BI.Widget._renderEngine.createFragment(); |
|
|
|
var fragment = BI.Widget._renderEngine.createFragment(); |
|
|
|
var added = []; |
|
|
|
var added = []; |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
var w = self._addElement(o.items.length, item); |
|
|
|
var w = self._addElement(o.items.length, item, context); |
|
|
|
self._children[self._getChildName(o.items.length)] = w; |
|
|
|
self._children[self._getChildName(o.items.length)] = w; |
|
|
|
o.items.push(item); |
|
|
|
o.items.push(item); |
|
|
|
added.push(w); |
|
|
|
added.push(w); |
|
|
@ -15071,14 +15071,14 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
prependItems: function (items) { |
|
|
|
prependItems: function (items, context) { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
items = items || []; |
|
|
|
items = items || []; |
|
|
|
var fragment = BI.Widget._renderEngine.createFragment(); |
|
|
|
var fragment = BI.Widget._renderEngine.createFragment(); |
|
|
|
var added = []; |
|
|
|
var added = []; |
|
|
|
for (var i = items.length - 1; i >= 0; i--) { |
|
|
|
for (var i = items.length - 1; i >= 0; i--) { |
|
|
|
this._addItemAt(0, items[i]); |
|
|
|
this._addItemAt(0, items[i]); |
|
|
|
var w = this._addElement(0, items[i]); |
|
|
|
var w = this._addElement(0, items[i], context); |
|
|
|
self._children[self._getChildName(0)] = w; |
|
|
|
self._children[self._getChildName(0)] = w; |
|
|
|
this.options.items.unshift(items[i]); |
|
|
|
this.options.items.unshift(items[i]); |
|
|
|
added.push(w); |
|
|
|
added.push(w); |
|
|
@ -41752,7 +41752,7 @@ BI.ListView = BI.inherit(BI.Widget, { |
|
|
|
}; |
|
|
|
}; |
|
|
|
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { |
|
|
|
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { |
|
|
|
var items = o.items.slice(index, index + o.blockSize); |
|
|
|
var items = o.items.slice(index, index + o.blockSize); |
|
|
|
this.container.addItems(items); |
|
|
|
this.container.addItems(items, this); |
|
|
|
var addedHeight = getElementHeight() - lastHeight; |
|
|
|
var addedHeight = getElementHeight() - lastHeight; |
|
|
|
this.cache[cnt] = { |
|
|
|
this.cache[cnt] = { |
|
|
|
index: index, |
|
|
|
index: index, |
|
|
@ -41871,7 +41871,7 @@ BI.VirtualList = BI.inherit(BI.Widget, { |
|
|
|
}; |
|
|
|
}; |
|
|
|
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { |
|
|
|
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { |
|
|
|
var items = o.items.slice(index, index + o.blockSize); |
|
|
|
var items = o.items.slice(index, index + o.blockSize); |
|
|
|
this.container.addItems(items); |
|
|
|
this.container.addItems(items, this); |
|
|
|
var addedHeight = getElementHeight() - lastHeight; |
|
|
|
var addedHeight = getElementHeight() - lastHeight; |
|
|
|
this.cache[cnt] = { |
|
|
|
this.cache[cnt] = { |
|
|
|
index: index, |
|
|
|
index: index, |
|
|
@ -41923,7 +41923,7 @@ BI.VirtualList = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.cache[i].destroyed === true) { |
|
|
|
if (this.cache[i].destroyed === true) { |
|
|
|
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) { |
|
|
|
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) { |
|
|
|
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j]))); |
|
|
|
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this); |
|
|
|
currentFragment.appendChild(w.element[0]); |
|
|
|
currentFragment.appendChild(w.element[0]); |
|
|
|
} |
|
|
|
} |
|
|
|
this.cache[i].destroyed = false; |
|
|
|
this.cache[i].destroyed = false; |
|
|
|