Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,
I want to get config variable which i want to get gobble access in my app, How can do it.

I want to define it in app.js
//Here I want to define it
Ext.application({
    name: 'vDemo',
    controllers: ['App'],
    launch: function () {
        this.getController('App');
    }
});

I want to use this variable for maintain user state. like we use session in ASP.NET.

I am new in Ext JS programming.
Please give an Idea to maintain user state in Ext JS Application.

What I have tried:

I am going to maintain user state in My Ext JS application
Posted
Updated 3-Jan-17 19:20pm

1 solution

You need to keep those values in a global file which gets included in the app. Make sure to name it correctly to avoid conflict.
Something like-
JavaScript
MyApp = {
    config:{
            property1:'value1',
            property2:'value2'
          }
}

Then you can access these values like-
JavaScript
myProperty1 = MyApp.config.property1;


Hope, it helps :)

Reference: javascript - How to read values from properties file in ExtJs - Stack Overflow[^]
 
Share this answer
 
Comments
Vikas Hire 11-Jan-17 1:52am    
Where I should place this code in my application

MyApp = {
config:{
property1:'value1',
property2:'value2'
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900