Guest User

Untitled

a guest
Jan 22nd, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. var _Example = {
  2. name:"com.technisode.example.App",
  3. kind:"Control",
  4. published:{
  5. a:1,
  6. b:2,
  7. c:3
  8. },
  9. components:[
  10. {kind:"IntegerPicker", name:"aPicker", label:"A"},
  11. {kind:"IntegerPicker", name:"bPicker", label:"B"},
  12. {kind:"IntegerPicker", name:"cPicker", label:"C"},
  13. {kind:"Button", onclick:"resetClicked"}
  14. ],
  15. create:function() {
  16. this.inherited(arguments);
  17. this.aChanged();
  18. this.bChanged();
  19. this.cChanged();
  20. },
  21. aChanged:function() {
  22. this.$.aPicker.setValue(this.a);
  23. },
  24. bChanged:function() {
  25. this.$.bPicker.setValue(this.b);
  26. },
  27. cChanged:function() {
  28. this.$.cPicker.setValue(this.c);
  29. },
  30. reset:function(property) {
  31. if(property) {
  32. enyo.call(this, "set" + enyo.cap(property), [this.published[property]]);
  33. } else {
  34. for(var k in this.published) {
  35. enyo.call(this, "set" + enyo.cap(k), [this.published[k]]);
  36. }
  37. }
  38. },
  39. resetClicked:function() {
  40. this.reset();
  41. }
  42. }
  43.  
  44. enyo.kind(_Example);
Add Comment
Please, Sign In to add comment