Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _Example = {
- name:"com.technisode.example.App",
- kind:"Control",
- published:{
- a:1,
- b:2,
- c:3
- },
- components:[
- {kind:"IntegerPicker", name:"aPicker", label:"A"},
- {kind:"IntegerPicker", name:"bPicker", label:"B"},
- {kind:"IntegerPicker", name:"cPicker", label:"C"},
- {kind:"Button", onclick:"resetClicked"}
- ],
- create:function() {
- this.inherited(arguments);
- this.aChanged();
- this.bChanged();
- this.cChanged();
- },
- aChanged:function() {
- this.$.aPicker.setValue(this.a);
- },
- bChanged:function() {
- this.$.bPicker.setValue(this.b);
- },
- cChanged:function() {
- this.$.cPicker.setValue(this.c);
- },
- reset:function(property) {
- if(property) {
- enyo.call(this, "set" + enyo.cap(property), [this.published[property]]);
- } else {
- for(var k in this.published) {
- enyo.call(this, "set" + enyo.cap(k), [this.published[k]]);
- }
- }
- },
- resetClicked:function() {
- this.reset();
- }
- }
- enyo.kind(_Example);
Add Comment
Please, Sign In to add comment