[qooxdoo-commit] SF.net SVN: qooxdoo: [4096] trunk/qooxdoo/frontend/framework/source/class/ qx/ui/
Brought to you by:
ecker,
martinwittemann
From: <ti...@us...> - 2006-08-31 15:33:32
|
Revision: 4096 http://svn.sourceforge.net/qooxdoo/?rev=4096&view=rev Author: til132 Date: 2006-08-31 08:33:22 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Ignore running request when reloadData was called Modified Paths: -------------- trunk/qooxdoo/frontend/framework/source/class/qx/ui/table/RemoteTableModel.js Modified: trunk/qooxdoo/frontend/framework/source/class/qx/ui/table/RemoteTableModel.js =================================================================== --- trunk/qooxdoo/frontend/framework/source/class/qx/ui/table/RemoteTableModel.js 2006-08-31 15:01:57 UTC (rev 4095) +++ trunk/qooxdoo/frontend/framework/source/class/qx/ui/table/RemoteTableModel.js 2006-08-31 15:33:22 UTC (rev 4096) @@ -44,6 +44,7 @@ this._firstLoadingBlock = -1; this._firstRowToLoad = -1; this._lastRowToLoad = -1; + this._ignoreCurrentRequest = false; this._rowBlockCache = {}; this._rowBlockCount = 0; @@ -107,6 +108,12 @@ qx.Proto.reloadData = function() { this.clearCache(); + // If there is currently a request on its way, then this request will bring + // obsolete data -> Ignore it + if (this._firstLoadingBlock != -1) { + this._ignoreCurrentRequest = true; + } + // NOTE: This will inform the listeners as soon as the new row count is known this._loadRowCount(); }; @@ -194,7 +201,7 @@ * @param rowDataArr {Map[]} the loaded row data or null if there was an error. */ qx.Proto._onRowDataLoaded = function(rowDataArr) { - if (rowDataArr != null) { + if (rowDataArr != null && ! this._ignoreCurrentRequest) { var blockSize = this.getBlockSize(); var blockCount = Math.ceil(rowDataArr.length / blockSize); if (blockCount == 1) { @@ -227,6 +234,7 @@ // We're not loading any blocks any more this._firstLoadingBlock = -1; + this._ignoreCurrentRequest = false; // Check whether we have to start a new request if (this._firstRowToLoad != -1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |