From 735a1afa43959c1a35e601da3276496d0708aff5 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 9 Dec 2013 21:37:39 +0000 Subject: [PATCH] Clear queue when results arrive, and in reset() --- etemplate/js/et2_dataview_controller.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etemplate/js/et2_dataview_controller.js b/etemplate/js/et2_dataview_controller.js index 1e82e3a5bb..f5eb7670fd 100644 --- a/etemplate/js/et2_dataview_controller.js +++ b/etemplate/js/et2_dataview_controller.js @@ -167,6 +167,9 @@ var et2_dataview_controller = Class.extend({ // Clear the grid this._grid.clear(); + // Clear the queue + this._queue = {}; + // Update the data this.update(); }, @@ -763,6 +766,10 @@ var et2_dataview_controller = Class.extend({ // count, if a specific count was requested 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]; + // Get the current index map for the updated region var idxMap = this.self._getIndexMapping(this.start, order.length);