-
6 Apr 2012 9:29 AM #1
Global Arrays & Variables
Global Arrays & Variables
I attempting to create a global or application specific array with in my launch:function().
Although when I attempt to retrieve either one of these variables within a Controller Action, I get this Reference ErrorCode:launch: function() { BrookshireBrothersMobile.globals = { enduser: '', dummy: 35 }; Ext.create('BrookshireBrothersMobile.view.Main', {fullscreen: true}); }
Also what is the proper way to declare an application specific or global array in the launch function?Code:ReferenceError- arguments: Array[1]
- 0: "enduser"
- length: 1
- __proto__: Array[0]
- get message: function getter() { [native code] }
- get stack: function getter() { [native code] }
- set message: function setter() { [native code] }
- set stack: function setter() { [native code] }
- type: "not_defined"
- __proto__: Error
Are there any examples of this in the sample code ?
- arguments: Array[1]
-
6 Apr 2012 10:00 AM #2
This looks fine... and I assume to access it you are doing
BrookshireBrothersMobile.globals.enduser?Aaron Conran
@aconran
Sencha Architect Development Team
-
6 Apr 2012 11:06 AM #3
Thanks for the response Aaron.
I tried that and now I get a TypeError
Code:TypeError- arguments: Array[2]
- 0: "enduser"
- 1: undefined
- length: 2
- __proto__: Array[0]
- get message: function getter() { [native code] }
- get stack: function getter() { [native code] }
- set message: function setter() { [native code] }
- set stack: function setter() { [native code] }
- type: "non_object_property_load"
- __proto__: Error
- arguments: Array[2]
-
6 Apr 2012 11:20 AM #4
Has launch run?
Step through with a debugger and/or some console.log/alert statementsAaron Conran
@aconran
Sencha Architect Development Team
-
6 Apr 2012 11:32 AM #5
Well here is where my novice experience with this technology hinders my comprehension.
I assumed launch had run since it's within the "Application Entry Point" which I associate with the main() method of a console application implemented in an actual programming language such as C, C# or whatever.
Since it's a function I should be able to call it, correct ?
Or how does one make launch "run" ?
-
6 Apr 2012 11:56 AM #6
It should run automatically.
You can put a console.log in and check out the console or set a breakpoint via a debugger; statementAaron Conran
@aconran
Sencha Architect Development Team
-
6 Apr 2012 12:06 PM #7
That's what I was thinking.
I placed a console.log within the launch method, so I know it's not running.
I'm not sure how to set breakpoints ?
-
6 Apr 2012 1:37 PM #8
Application launch should be getting run... maybe you are hitting some syntax error. Does any error occur?
Aaron Conran
@aconran
Sencha Architect Development Team
-
6 Apr 2012 1:43 PM #9
No, not when I look in the Chrome's Console. I see a few warnings from having some components with the same id but no errors.
-
6 Apr 2012 1:52 PM #10
I'd gladly take a look at your project, but without it I'm shooting a bit in the dark. Does your app launch? or you just get a blank screen?
Aaron Conran
@aconran
Sencha Architect Development Team



Reply With Quote