How To Access Static Variables In Sencha Touch

Take this class for example where it contains 1 field named domain that contains a url string.

Ext.define('MyProject.myfolder.Test', {
    statics: {
        domain: "http://www.cnn.com/"
    },
});

This Javascript file is located in a folder named myfolder where the view, model and controller folders are.

To access the variable, do the following.

var def = Ext.create('Medworx.model.property.Default');
var defClass = Ext.getClass(def);
alert(defClass.domain);

Donations appreciated. Every little $ helps. Or click Google +1.

Related Posts Plugin for WordPress, Blogger...

Post a Comment