1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    5
    Vote Rating
    0
    andrewchooah is on a distinguished road

      0  

    Default How to edit application 'config'? (Sencha.io example)

    How to edit application 'config'? (Sencha.io example)


    I'm working through this Sencha.io example. It requires an 'io' property in the application config as follows:


    config: { io: { appId: "5ZarPd0Cu6XyZC15AVHTE1BXq6C", appSecret: "xlK93iMvE8nsYEfk" } },
    As I'm using Architect, I can't freely edit the Application code. I've tried adding a custom property entitled 'config', but it returns a warning that this is a protected property (understandably).

    Does anybody know how to go about implementing the above code in Architect?

  2. #2
    Sencha User
    Join Date
    Sep 2012
    Posts
    5
    Vote Rating
    0
    andrewchooah is on a distinguished road

      0  

    Default


    I have come up with a solution, but I am still open to any newer / better ideas.

    My current solution is as follows:

    Create app / util / config.js:

    Code:
    Ext.define('YOURAPPNAME.util.Config', {
        singleton : true,
    
    
        config : {
        
            io: {
    	        appId: "YOUR ID",
    	        appSecret: "YOUR SECRET"
    	    }
        }
    });
    In your application 'Requires' add: YOURAPPNAME.util.Config

    This makes your app load in a utility file which runs before the app is shown, loading in any configuration you would like to include. The config.js file is not picked up by architect, you must manage it manually using a text editor - this means architect and your custom code won't cross paths, and you don't have to worry about Architect overwriting any manual edits you make outside of the IDE.

    Unfortunately the above doesn't completely work - despite setting the values hardcoded in the config.js file, the app sees them as null values when I query them. Therefore on app Launch I have to add:

    Code:
    YOURAPPNAME.util.Config.setIo({appId: "SOME VALUE",appSecret: "SOME VALUE"});
    Then if I want to access my appSecret for example, anywhere in the app, I simply call:

    Code:
    var ioconfig = ADPro.util.Config.getIo();
    secret = ioconfig.appSecret;
    If anybody knows how to get around the null values problem (to eliminate having to setIo on launch), it would be much appreciated.

    If not, I hope this helps somebody out there.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Location
    Dublin
    Posts
    72
    Vote Rating
    11
    iplanit will become famous soon enough

      0  

    Default


    Did you try to add a JS Resource ? I will have to test sencha.io too. This information will be useful.
    Quote Originally Posted by andrewchooah View Post
    I have come up with a solution, but I am still open to any newer / better ideas.

    My current solution is as follows:

    Create app / util / config.js:

    Code:
    Ext.define('YOURAPPNAME.util.Config', {
        singleton : true,
    
    
        config : {
        
            io: {
                appId: "YOUR ID",
                appSecret: "YOUR SECRET"
            }
        }
    });
    In your application 'Requires' add: YOURAPPNAME.util.Config

    This makes your app load in a utility file which runs before the app is shown, loading in any configuration you would like to include. The config.js file is not picked up by architect, you must manage it manually using a text editor - this means architect and your custom code won't cross paths, and you don't have to worry about Architect overwriting any manual edits you make outside of the IDE.

    Unfortunately the above doesn't completely work - despite setting the values hardcoded in the config.js file, the app sees them as null values when I query them. Therefore on app Launch I have to add:

    Code:
    YOURAPPNAME.util.Config.setIo({appId: "SOME VALUE",appSecret: "SOME VALUE"});
    Then if I want to access my appSecret for example, anywhere in the app, I simply call:

    Code:
    var ioconfig = ADPro.util.Config.getIo();
    secret = ioconfig.appSecret;
    If anybody knows how to get around the null values problem (to eliminate having to setIo on launch), it would be much appreciated.

    If not, I hope this helps somebody out there.

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    St. Louis
    Posts
    1
    Vote Rating
    0
    samb is on a distinguished road

      0  

    Default Sencha keeps getting better

    Sencha keeps getting better


    Upgrade to the latest version of the io sdk. Look at the example architect file named "sio" in the example folder.
    You can see how sencha developers implement this with a custom config.
    Reference
    http://docs.sencha.com/architect/2/#...e/config_panel
    for how to set a custom configuration in Application in Project Inspector.
    Sam

Thread Participants: 2

Tags for this Thread

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