Search code examples
enyo

How to set properties in enyo


in enyo I can't find any documentation that tells tyou how to chnage the Properties. For example in the documentation it has disabled as one of the properties. What would the java script code be to set that property, so I could make the button go on and off?


Solution

  • Let's say you have something like:

    /* Enyo controls code */
    {name: "detailButton", disabled:true, caption: "Details"},
    /* More Enyo code */
    

    To change that property, just use Enyo's property system:

    myFunction: function() {
        this.$.detailButton.setDisabled(false);
    }
    

    You can define your own properties using:

    published:{
        myProperty: ""
    }
    

    You will then have a setMyProperty() function and a myPropertyChanged() to observe changes in your property