How to define constants file in sencha touch 2.0
Hi,
I want to make one properties file that will contain all the constants for my application. Can anyone please help me out how to do this in Sencha Touch 2.0 and how to access that file and constants defined in the file in my controllers, views and model. This property file will contain all my application specific constants as we do in Java.
Thanks,
Divya
Require class for constants..
I tested the solution, but I got everytime: Uncaught TypeError: Cannot read property 'Config' of undefined
My code was:
Code:
Ext.application({
controllers: [....],
models: [.....],
name: 'MyApp',
views: ['...'],
stores:['...'],
.....
launch: function() {
Ext.require('MyApp.util.Config');
........
Ext.Ajax.request({
url: MyApp.util.Config.getUrlLocalProxy() + '/',
....
}
The Config.js file is exactly an copy of the sample.
Code:
Ext.define('MyApp.util.Config', {
singleton : true,
config : {
urlLocalProxy: '127.0.0.1/utilityProxy.php'
},
constructor: function(config) {
this.initConfig(config);
this.callParent([config]);
}
});
Is there any else to do?
Thanks,
Daniel