Changeset 13896
- Timestamp:
- 06/04/08 15:23:27 (7 months ago)
- Files:
-
- 1 modified
-
dojox/trunk/grid/DataGrid.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojox/trunk/grid/DataGrid.js
r13860 r13896 15 15 _cache: null, 16 16 _pages: null, 17 _pending_requests: null, 17 18 _bop: -1, 18 19 _eop: -1, … … 26 27 this._rows = []; 27 28 this._cache = []; 29 this._pending_requests = {}; 28 30 29 31 this._setStore(this.store); … … 116 118 117 119 _onFetchComplete: function(items, req){ 118 if(!items || items.length == 0){ return; } 119 //console.log(items); 120 dojo.forEach(items, function(item, idx){ 121 this._addItem(item, req.start+idx); 122 }, this); 123 if(req.isRender){ 124 this.setScrollTop(0); 125 this.postrender(); 126 } 120 if(items && items.length > 0){ 121 //console.log(items); 122 dojo.forEach(items, function(item, idx){ 123 this._addItem(item, req.start+idx); 124 }, this); 125 if(req.isRender){ 126 this.setScrollTop(0); 127 this.postrender(); 128 } 129 } 130 this._pending_requests[req.start] = false; 127 131 }, 128 132 … … 136 140 137 141 _fetch: function(start, isRender){ 138 if(this.store){ 139 var start = start || 0; 142 var start = start || 0; 143 if(this.store && !this._pending_requests[start]){ 144 this._pending_requests[start] = true; 140 145 //console.log("fetch: ", start); 141 146 this.store.fetch({ … … 209 214 210 215 // paging 211 _requestsPending: function(inBoolean){ 216 _requestsPending: function(inRowIndex){ 217 return this._pending_requests[inRowIndex]; 212 218 }, 213 219 … … 241 247 if(count > 0){ 242 248 this._requests++; 243 this._requestsPending(true); 244 setTimeout(dojo.hitch(this, "_fetch", row, false), 1); 245 //this.requestRows(row, count); 249 if(!this._requestsPending(row)){ 250 setTimeout(dojo.hitch(this, "_fetch", row, false), 1); 251 //this.requestRows(row, count); 252 } 246 253 } 247 254 },