PDA

View Full Version : Problem with Global variables when using SDK tools



marxan
7 Dec 2012, 2:38 AM
Hello,

I have compiled my application with SDK, everything went fine during the compilation. However when I launch my app, I have now the following issue related to my global var:

Global is not defined
http://localhost/Tab/app-all.js

here's the code of my app.js:



Ext.application({
name: 'TAB',
// requires:['TAB.Global'],
appFolder: 'app',
enableQuickTips:false,
autoCreateViewport: true,

controllers: ['MainBorder', 'Countries' , 'Indicator',
'ExcelOptions', 'GraphOptions', 'TrapsGraph','NidiDetailsGraph'],


launch: function() {
}

}),


Ext.define('Global', {
singleton: true,


awPreviousEarning: '',
indicator: '',
codefc: '',
countries: 'All EU countries',
awEarningLevels: '',
duration: '',
indicatorGroup: 'TRAPS',
codeSelected: '',
codeListToLoad: '',
codeListAlreadyLoaded: '',
years: '',
lastYear: 'off',
axe: 'C',
indicatorCode: 'on',
indicatorLabel: 'off',
countriesCode: 'on',
countriesLabel: 'off',
famCompoCode: 'on',
famCompoLabel: 'off',
codeForGraph: '',
countryNidi: 'Belgium',
famCompoNidi: ''
});





At the end of app-all.js, it seems that it has been taken into account:


,launch:function(){}}),Ext.define("Global",{singleton:true,awPreviousEarning:"",indicator:"",codefc:"",countries:"All EU countries",awEarningLevels:"",duration:"",indicatorGroup:"TRAPS",codeSelected:"",codeListToLoad:"",codeListAlreadyLoaded:"",years:"",lastYear:"off",axe:"C",indicatorCode:"on",indicatorLabel:"off",countriesCode:"on",countriesLabel:"off",famCompoCode:"on",famCompoLabel:"off",codeForGraph:"",countryNidi:"Belgium",famCompoNidi:""});

If anyone could help because I really think that using SDK will improve the loading of my app (more than 12 seconds now to load it)

mitchellsimoens
9 Dec 2012, 8:07 AM
I see your class has a class name of Global but in the requires you have TAB.Global, this is incorrect, should just be Global or change the class name to TAB.Global.

marxan
10 Dec 2012, 1:02 AM
Thanks! what a noobie mistake! Friday evening is not the most performing day!