dojox.image.ThumbnailPicker._loadNextPage
dojo.require("dojox.image.ThumbnailPicker");
defined in dojox/image/ThumbnailPicker.js
Loads the next page of thumbnail images
Usage
function () (view source)
if(this._loadInProgress){return;} this._loadInProgress = true; var start = this.request.start + (this._noImages ? 0 : this.pageSize); var pos = start; while(pos < this._thumbs.length && this._thumbs[pos]){pos ++;} //Define the function to call when the items have been //returned from the data store. var complete = function(items, request){ if(items && items.length){ var itemCounter = 0; var loadNext = dojo.hitch(this, function(){ if(itemCounter >= items.length){ this._loadInProgress = false; return; } var counter = itemCounter++; this._loadImage(items[counter], pos + counter, loadNext); }); loadNext(); //Show or hide the navigation arrows on the thumbnails, //depending on whether or not the widget is at the start, //end, or middle of the list of images. this._updateNavControls(); }else{ this._loadInProgress = false; } }; //Define the function to call if the store reports an error. var error = function(){ this._loadInProgress = false; console.debug("Error getting items"); }; this.request.onComplete = dojo.hitch(this, complete); this.request.onError = dojo.hitch(this, error); //Increment the start parameter. This is the dojo.data API's //version of paging. this.request.start = start; this._noImages = false; //Execute the request for data. this.imageStore.fetch(this.request);