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. Or play the short video on the upper right of this page.

How To Include Normal Javascript Files In Sencha Touch

You can add normal Javascript files with functions or variables and re-use them within your Sencha Touch project by going to app.json and look for the line where “js” is where paths are specified.

Simple add another entry specifying the folder and Javascript filename.

"js": [
{ "path": "util/Test.js" },
{ "path": "sdk/sencha-touch.js"	},
{
"path": "app.js",
"bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
}
],

In the sample code above, the Test.js Javascript file is placed in a folder named util which is located in the same folder where app.json is.

Donations appreciated. Every little $ helps. Or click Google +1. Or play the short video on the upper right of this page.

The New iPod Touch and Nano

It is September 1 and as expected, Apple released their new model for the iPod Touch and its features are hardly surprising since there is no way that the iTouch will have at least one feature not present in the iPhone. Still, let’s just call the new iPod Touch as an iPhone without a sim. It had to be done sooner or later and they finally decided to place it in this model … the camera.

It also has a pretty cute logo, with colorful fingerprints adoring the words “touch”. What surprised me though, was the NANO. It looks like a bit of an oversized shuffle except that old NANO owners will get pissed because it now boasts of a touch screen interface.

Sorry, but that is how Apple works. People still buy the new stuffs anyway so the more they abuse their power to make things work that way. Check out the Apple website to see more photos and information regarding the new iTouch and Nano.

Donations appreciated. Every little $ helps. Or click Google +1. Or play the short video on the upper right of this page.

Related Posts Plugin for WordPress, Blogger...