1. #1
    Touch Premium Member pkellner's Avatar
    Join Date
    Sep 2008
    Location
    San Jose, California
    Posts
    781
    Vote Rating
    24
    pkellner will become famous soon enough pkellner will become famous soon enough

      0  

    Default How to create constants in ST2 (with SenchaArchitect)

    How to create constants in ST2 (with SenchaArchitect)


    I saw this post
    http://www.sencha.com/forum/showthre...ncha-touch-2.0
    which explains how to do it if you can put out your own javascript files in the directory specified, but I'm not sure how to do it in SA. I tried putting this in my app launch but of course it does not work because I've only defined my variable.

    Code:
    Ext.define('tweets.constants', {
        singleton : true,
        
         config : {
             baseUrl: 'http://xxx.azurewebsites.net/',
        },
       
       constructor: function(config) {
            this.initConfig(config);
    
    
            this.callParent([config]);
        }
    });
    Last edited by pkellner; 18 Jan 2013 at 6:43 PM. Reason: took out real url

  2. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      1  

    Default


    The first thing you have to do is to add a new path to the app loader config.
    So, talking about best uses, I suggest you to put change the constants namespace to

    Code:
    tweets.util.contants
    In this way if you have other util classes, you don't need to add a new path to the loader config.
    So, follow these steps:
    • Select the "Application" node, search for the "loader" config and select it.
    • Sencha Architect now have created a "loader" node for you, so select it, search for the path config and hit the edit button.
    • Add the "twees.util" path (the path object should looks like follows)
    Code:
    {
        "Ext":".", 
        "tweets.util": "util"
    }
    • Select the Application node and edit the "requires" config object adding your constants class (tweets.util.contastants).
    • Create a folder named "util" under your project root directory and put the "constants.js" file inside it.
    Now you are ready to use your app defined constants.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi