Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    31
    Answers
    1
    Vote Rating
    0
    eilijah is on a distinguished road

      0  

    Default Unanswered: Is it a way to set global variables for the application ?

    Unanswered: Is it a way to set global variables for the application ?


    Hello,

    Is it possible to set globals before loading the first controller and view?
    For example i have a app.js which got :
    app.js :
    Code:
    Ext.application({    name: 'app',
    
    
        controllers: [
    		'Main',
    	],
    });
    and a
    controllers/Main.js :
    Code:
    Ext.define('IdeoSlideShow.controller.Main', {    extend: 'Ext.app.Controller',
    	
        views: [
    		'Home',
    	],
    ...
    The Home view and the Main controller are loaded before i can do anything in the init functions.
    Is it possible to set a global variable to configure the Home view?
    For example if i want to set the itemTpl of my Home view list with a global variable how can i do that ?


    regards

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    125
    Answers
    1
    Vote Rating
    0
    oddz is on a distinguished road

      0  

    Default


    Global variables are a bad idea. What exactly are you trying to achieve? Seems like it would be more appropriate to create a store and model for hosting what seems to be configuration values.

  3. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Answers
    93
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Perhaps in your controller you could use the appropriate setters on your view?

    Code:
    init: function() {
        this.getHome().setItemTpl('adsasd');
    }
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 2

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