}
if (opts.update || opts.reset) {
- this.uidlist = l;
- this.rowlist = $H();
- } else {
- this.uidlist = this.uidlist.size() ? this.uidlist.merge(l) : l;
+ this.resetRowlist();
}
l.each(function(o) {
+ this.data.get(o.key).VP_rownum = o.value;
this.rowlist.set(o.value, o.key);
}, this);
isNearingLimit: function(offset)
{
- if (this.uidlist.size() != this.getMetaData('total_rows')) {
+ if (this.rowlist.size() != this.getMetaData('total_rows')) {
if (offset != 0 &&
this._rangeCheck($A($R(Math.max(offset + 1 - this.vp.limitTolerance(), 1), offset)))) {
return 'top';
if (!e.VP_domid) {
e.VP_domid = 'VProw_' + (++this.vp.id);
}
- e.VP_rownum = this.uidlist.get(u);
e.VP_id = u;
return e;
}
getAllUIDs: function()
{
- return this.uidlist.keys();
+ return this.rowlist.values();
},
getAllRows: function()
var id = this.rowlist.get(n), r;
if (rownums.include(n)) {
this.data.unset(id);
- this.uidlist.unset(id);
rowsubtract++;
} else if (rowsubtract) {
r = n - rowsubtract;
this.rowlist.set(r, id);
- this.uidlist.set(id, r);
+ this.data.get(id).VP_rownum = r;
}
if (n > newsize) {
this.rowlist.unset(n);
removeData: function(uids)
{
- uids.each(function(u) {
- this.data.unset(u);
- this.uidlist.unset(u);
- }, this);
+ uids.each(this.data.unset.bind(this.data));
},
resetRowlist: function()
{
this.data = $H();
this.mdata = $H({ total_rows: 0 });
- this.rowlist = $H();
this.selected = new ViewPort_Selection(this);
- this.uidlist = $H();
this.usermdata = $H();
+ this.resetRowlist();
},
getMetaData: function(id)