Guest User

Untitled

a guest
Jun 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. dojo.provide("website.widget.Repeater")
  2.  
  3. dojo.require("dojox.dtl._Templated");
  4. dojo.require("dijit._Widget");
  5.  
  6. dojo.declare("website.widget.Repeater", [dijit._Widget, dojox.dtl._Templated], {
  7. _dijitTemplateCompat: true,
  8. store: null,
  9. templatePath: null,
  10. items: null,
  11. postCreate: function()
  12. {
  13. //console.debug(store);
  14. dojo.addClass(this.domNode, 'dataLess');
  15. this.store.fetch(
  16. {
  17. query: {name: "*"},
  18. onComplete: dojo.hitch(this, function(items){this.showData(items);}),
  19. onError: function(error, request) {alert(error + "\n" + request);}
  20. }
  21. );
  22. },
  23. showData: function(items)
  24. {
  25. alert(this.items.length);
  26. this.items = items;
  27. for (item in this.items)
  28. alert(item.name);
  29. this.render();
  30. dojo.removeClass(this.domNode,'dataLess');
  31. }
  32. });
Add Comment
Please, Sign In to add comment