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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar