Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7675469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:58:13+00:00 2026-05-31T16:58:13+00:00

I am working on a Sencha Touch application and I am learning it great

  • 0

I am working on a Sencha Touch application and I am learning it great because I love JavaScript.

This is my app.js

var App = new Ext.Application({
    name: 'My First App',

    //BaseURL: 'http://mydomain.com/testing/first/services/',

    launch: function() {
        this.views.viewport = new this.views.Viewport();

        // this.BaseURL = "http://mydomain.com/testing/first/services/";
    }
});

This is one of my Store.

var newsStore = new Ext.data.Store({
    model: 'News',
    sorters: [{
        property: 'PostedOn',
        direction: 'DESC'
    }],
    proxy: {
        type: 'ajax',
        url: 'http://mydomain.com/testing/first/services/News.php',
        reader: {
            type: 'xml',
            root: 'News',
            record: 'New'   
        }
    },
    getGroupString: function(record) {
        if (record && record.data.PostedOn) {
            return record.get('PostedOn').toDateString();
        }
        else {
            return '';
        }
    },
    autoLoad: true
});

Now the question is, if I can create a global variable across whole application? It’s named BaseURL and I can use it among all Data Stores and when need to change it, I just change this to reflect across whole application.

I need to know two things.

  1. How to declare a global application level variable.
  2. How to access that variable in views and stores.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:58:15+00:00Added an answer on May 31, 2026 at 4:58 pm

    I would recommend adding your custom global variables to the application namespace, like this:

    Ext.application({
      name: 'MyApp',
      launch: function() { },
      apiToken: 'foo'
    });
    

    This way you will be able to access these custom variables after your application has launched:

    MyApp.app.apiToken
    

    It works with functions, too:

    Ext.application({
      name: 'MyApp',
      launch: function() { },
      apiToken: 'foo',
      getApiToken: function() { return this.apiToken; }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working Ext.List object in my Sencha Touch application. I'm rendering each
I am working on a mobile application and using sencha touch charts. By default
I'm just working on a web application with sencha touch. I need to implement
I'm programming a Sencha Touch app with a moderately complex composition of Ext.TabBar with
I'm working on a Sencha Touch application, and have a list of contacts. When
I'll begin with the usual disclaimer: new to Sencha Touch/working with JSON, floundering in
I'm quite new to sencha touch. The goal is to create an app which
I am very new to sencha touch. Working with sencha touch to develop bar
I am trying to learn Sencha Touch and am working on an app which
I am working on an application with sencha touch charts. By default the chart's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.