Fix bug in using knownUIDs where empty rows were left or too many removed when the count changed

This commit is contained in:
Nathan Gray
2014-03-19 19:19:34 +00:00
parent e3538302fc
commit 133c4a317c
3 changed files with 116 additions and 79 deletions

View File

@ -756,7 +756,6 @@ var et2_dataview_controller = Class.extend({
// index entry
for (var i = mapIdx; i < _idxMap.length; i++)
{
this._grid.deleteRow(i);
if(typeof _idxMap[i] != 'undefined')
{
_idxMap[i].uid = null;
@ -824,9 +823,18 @@ var et2_dataview_controller = Class.extend({
var order = this.count != 0 ? _response.order.splice(0, this.count) : _response.order;
// Remove from queue, or it will not be fetched again
for(var i = this.start; i < this.start + order.length; i++)
delete this.self._queue[i];
if(_response.total < this.count)
{
// Less rows than we expected
// Clear the queue, or the remnants will never be loaded again
this.self._queue = {};
}
else
{
for(var i = this.start; i < this.start + order.length; i++)
delete this.self._queue[i];
}
// Get the current index map for the updated region
var idxMap = this.self._getIndexMapping(this.start, order.length);