-
4 Dec 2011 10:12 AM #1
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 :
and aCode:Ext.application({ name: 'app', controllers: [ 'Main', ], });
controllers/Main.js :
The Home view and the Main controller are loaded before i can do anything in the init functions.Code:Ext.define('IdeoSlideShow.controller.Main', { extend: 'Ext.app.Controller', views: [ 'Home', ], ...
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
-
4 Dec 2011 12:03 PM #2
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.
-
4 Dec 2011 12:33 PM #3
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.


Reply With Quote