Threaded View

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    40
    Vote Rating
    0
    pkvenu is on a distinguished road

      0  

    Default Answered: Create a config file

    Answered: Create a config file


    Hi guys,

    can some one tell me how to create a config file so that i could use it across the application.

    In JavaScript i would create a file called config and

    Code:
    ar mapserviceUrl1 = "http://204.94.80.163/ArcGIS/rest/services/";
    var mapserviceUrl = "http://map1-2.lan.511.org/ArcGIS/rest/services/";
    //var localImageDir = mapImageDirectory;
    
    
    function mapConfig() { };
    var mapconfig = new mapConfig();
    //mapConfig.prototype.LocalImageDir = localImageDir;
    
    mapConfig.prototype.generalSettings = {
        defaultZoomLevel: 2, 
        defaultQueryTolerancePixels:2
    }
    
    mapConfig.prototype.generalSettings = {
        defaultZoomLevel: 2,
        defaultQueryTolerancePixels: 2
    };
    
    mapConfig.prototype.spatialReference = {
        parking: new esri.SpatialReference({ wkid: 4269 })
    };
    and then call mapconfig.generalSetting to get the general setting values in my application.

    How can i perform the same in sencha touch 2

    Regards,
    Paw

  2. You can still create a config file and include it as a <script> tag in your index.html file. The namespace won't be setup if you are wanting to use a namespace like in the MVC. If you are using MVC, I personally create a singleton that I require first...

    Code:
    Ext.define('MyApp.Config', {
        singleton : true,
    
        config : {
            urls : {
                users : 'users/get.php'
            }
        }
    });
    Above your Ext.application call you can then use Ext.require to load this file:

    Code:
    Ext.Loader.setPath('MyApp', 'app');
    
    Ext.require([
        'MyApp.Config'
    ]);
    Within your application classes you can get a url via:

    Code:
    MyApp.Config.getUrls().users

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