1c3e290e2cacd3cf48e02ac46b957dbe7fba5360.svn-base 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. if (!dojo._hasResource["dojox.data.demos.widgets.PicasaViewList"]) { // _hasResource
  2. // checks
  3. // added
  4. // by
  5. // build.
  6. // Do
  7. // not
  8. // use
  9. // _hasResource
  10. // directly
  11. // in
  12. // your
  13. // code.
  14. dojo._hasResource["dojox.data.demos.widgets.PicasaViewList"] = true;
  15. dojo.provide("dojox.data.demos.widgets.PicasaViewList");
  16. dojo.require("dijit._Templated");
  17. dojo.require("dijit._Widget");
  18. dojo.require("dojox.data.demos.widgets.PicasaView");
  19. dojo.declare("dojox.data.demos.widgets.PicasaViewList", [dijit._Widget,
  20. dijit._Templated], {
  21. // Simple demo widget that is just a list of PicasaView Widgets.
  22. templateString : "<div dojoAttachPoint=\"list\"></div>\n\n",
  23. // Attach points for reference.
  24. listNode : null,
  25. postCreate : function() {
  26. this.fViewWidgets = [];
  27. },
  28. clearList : function() {
  29. while (this.list.firstChild) {
  30. this.list.removeChild(this.list.firstChild);
  31. }
  32. for (var i = 0; i < this.fViewWidgets.length; i++) {
  33. this.fViewWidgets[i].destroy();
  34. }
  35. this.fViewWidgets = [];
  36. },
  37. addView : function(viewData) {
  38. var newView = new dojox.data.demos.widgets.PicasaView(viewData);
  39. this.fViewWidgets.push(newView);
  40. this.list.appendChild(newView.domNode);
  41. }
  42. });
  43. }