| 1 | dojo.provide("dojox.data.demos.widgets.FlickrViewList"); |
| 2 | dojo.require("dojox.dtl._Templated"); |
| 3 | dojo.require("dijit._Widget"); |
| 4 | |
| 5 | dojo.declare("dojox.data.demos.widgets.FlickrViewList", |
| 6 | [ dijit._Widget, dojox.dtl._Templated ], |
| 7 | { |
| 8 | store: null, |
| 9 | items: null, |
| 10 | |
| 11 | templateString: dojo.cache("dojox", "data/demos/widgets/templates/FlickrViewList.html"), |
| 12 | |
| 13 | fetch: function(request){ |
| 14 | request.onComplete = dojo.hitch(this, "onComplete"); |
| 15 | request.onError = dojo.hitch(this, "onError"); |
| 16 | return this.store.fetch(request); |
| 17 | }, |
| 18 | |
| 19 | onError: function(){ |
| 20 | console.trace(); |
| 21 | this.items = []; |
| 22 | this.render(); |
| 23 | }, |
| 24 | |
| 25 | onComplete: function(items, request){ |
| 26 | this.items = items||[]; |
| 27 | this.render(); |
| 28 | } |
| 29 | } |
| 30 | ); |