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 9161777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:03:00+00:00 2026-06-17T14:03:00+00:00

Should I extend Ext.app.Application class in Sencha Touch 2? I have functionality which is

  • 0

Should I extend Ext.app.Application class in Sencha Touch 2?
I have functionality which is common for several applications, for example: do something for all stores configured in the application.
If yes, how do I start the application in app.js?

  • 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-06-17T14:03:01+00:00Added an answer on June 17, 2026 at 2:03 pm

    I will answer for ExtJS 4.0.x / 4.1.x and SenchaTouch 2.0.x / 2.1.x

    You should not extend Ext.app.Application

    Why?

    You only can only have one active application at a time which should (need to be) always be configured & startet by calling Ext.application({...});.

    As always there are ways around this (in both frameworks) which would then allow you to use your own instance. But would not recommend it!

    What would be needed?

    Basically the only thing that is required is to reimplement and extend the code within the Ext.application method so that it is capable to handle any other class then Ext.app.Application. I will just add a SenchaTouch example, for ExtJS see ExtJS4.2 section below the code.

    SenchaTouch example

    application: function(appClass,config) {
        var appName = config.name,
            onReady, scope, requires;
    
        if (!config) {
            config = {};
        }
    
        if (!Ext.Loader.config.paths[appName]) {
            Ext.Loader.setPath(appName, config.appFolder || 'app');
        }
    
        requires = Ext.Array.from(config.requires);
        config.requires = [appClass];
    
        onReady = config.onReady;
        scope = config.scope;
    
        config.onReady = function() {
            config.requires = requires;
            Ext.create(appClass, config);
    
            if (onReady) {
                onReady.call(scope);
            }
        };
    
        Ext.setup(config);
    },
    

    A note to ExtJS 4.2

    Sencha has announced ExtJS 4.2 which will allow us to extend from the Ext.app.Application class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Sencha Touch 2.1 model class: Ext.define('App.model.User', { extend: 'Ext.data.Model', config:
I have a menu which is defined like that: Ext.define('MyApp.FileBrowserContextMenu', { extend: 'Ext.menu.Menu', initComponent:
I have the following Viewport that houses my app... Ext.define('my.view.Viewport', { extend: 'Ext.Viewport', id:
I develop an app for Android with Sencha Touch and Phonegap (cordova-2.0.0). I have
I'm quite new to sencha touch. The goal is to create an app which
I have a ProjectsController like: Ext.define('SimpleTodo.controller.ProjectsController', { extend: 'Ext.app.Controller', refs: [ { ref: 'addProjectPanel',
I have created a view like this Ext.define('App.view.Message', { extend: 'Ext.Panel', alias: 'widget.message', config:
I have a Sencha Touch 2.0 app that is set up with a card
For example I have 2 models: Ext.define('Order', { extend : 'Ext.data.Model', fields : [
Should I include/require_once the parent class that I am extending in PHP? for example

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.