I'm noticing that uses and requires from the Ext.class aren't working using minified js generated by Sencha cmd tool. I'm defining two classes,suppose class A and B, B class requires that Instace of A should be created which has an ajax call in it's contructore to pull some values from the server side code, this works perfectly when I'm using regular js structure having classes, store, models,etc..but that is not the case after building minified js using Secha cmd, Is it possible to instatiate these singletone synchronously before application starts loading views or anyother suggestion you would like to suggest to solve this issue? Please note I'm using ExtJs 4.2
Ext.define('A', {
alternateClassName:'AClass',
singleton:true,
constructor: function(config) {
this.initConfig(config);
Ext.Ajax.request({
url : 'XXX.html',
method : 'POST',
headers: { 'Content-Type' : 'application/json',
},
success : function(response, opts) {
appProps = JSON.parse(response.responseText).items;
},
failure : function(response, opts) {
}
});
return this;
},
config: {
appProperties: '%XXX_PROPPERTIES%',
accSysMnemonic:'',
assetTypeForExAccCat:'',
appProps : ''
},
getValue : function(key){
props = appProps;
var value = props[key];
return value;
}});
Ext.define('B', {
requires:['A'],
alternateClassName : 'BClass',
singleton : true,
config : {
},
constructor : function(config) {
this.initConfig(config);
return this;
},
hasvalue : function(val) {
if(A.getValue('XXX') === 'false' || A.getValue('XXX') === undefined){
console.log('XXX is false');
return true;
}else{
return false;
}
}});