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

  • Home
  • SEARCH
  • 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 9167533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:24:50+00:00 2026-06-17T15:24:50+00:00

I’ve created an application using Ext JS 4. controllers property in my app.js contains

  • 0

I’ve created an application using Ext JS 4. controllers property in my app.js contains only the main controller:

Ext.application({
    name: 'MyApp',
    appFolder: 'app',

    controllers: [
        "main.App"
    ],

    loadController: function(controller) {
        var oController = this.getController(controller);
        oController.init(this);
        oController.onLaunch(this);
    }
});

MyApp.main.App controller loads additional controllers by name using getController() approach (see loadController() method). These controllers are loaded dynamically and are not listed in my index.html file.

In order to generate production version for deployment to server I am using Sencha Cmd by issuing the following command in my application folder:

sencha app build

Tool finishes normally and compresses all files into one big all-classes.js. The problem is that my dynamically loaded controllers are not included in that file.

Which is the correct way to make dynamically loaded controllers (over 100 in total) to be minified and processed by Sencha Cmd?

I know, that I can list them in my app.js, or include in some file using Ext.require, but I am seeking for correct approach for including over than 100 different controllers, views, models and stores automatically in my build. I believe that are other users of Ext JS, which are creating large-scale applications and are building somehow and I’ll be grateful for any suggestions or just success stories, which will help me to find the correct way to build.

  • 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-17T15:24:51+00:00Added an answer on June 17, 2026 at 3:24 pm

    I would put all controllers into the uses array. These should force the tool to keep track on them and include them into the build. On the other hand uses does not require the class to be available at definition time but guarantee them to be available the time the onReady(one is within the application) block(s) is(are) called.

    Note that you will need to use the fully qualified names within the
    uses array!

    I do not use the buildtool therefore I cannot test it but it should work.


    Update from the comments example provided by @bhovhannes

    bhovhannes: I’ve added a code in build.xml, which collects all names of
    my controllers into uses array when I do sencha app build. This way I
    fill nothing in uses array during development, just add controllers
    into controller folder, because all them are loaded dynamically from
    my app

    app.js

    Ext.application({
        name: 'MyApp',
        appFolder: 'app',
    
        controllers: [
            "main.App"
        ],
    
        uses: [
            /*ant-generated-content-start*/ /*ant-generated-content-end*/
        ],
    
        autoCreateViewport: true,
    });
    

    build.xml

    <?xml version="1.0" encoding="utf-8"?>
    <project name="MyApp" default=".help">
        <import file="${basedir}/.sencha/app/build-impl.xml"/>
    
        <target name="-before-build">
    
            <echo message="Collecting all controllers in application class property ... "/>
            <fileset id="app_controllers" dir="${app.dir}/app/controller" casesensitive="yes">
                <include name="**/*.js"/>
            </fileset>
            <pathconvert pathsep="," property="app_controller_names" refid="app_controllers" targetos="unix">
                <chainedmapper>
                    <globmapper from="${app.dir}/app/*" to="${ant.project.name}/*" casesensitive="no" handledirsep="yes"/>
                    <chainedmapper>
                        <regexpmapper from="^(.*)\.js$$" to='"\1"'/>
                        <filtermapper>
                            <replacestring from="/" to="."/>
                            <replacestring from="\" to="."/>
                        </filtermapper>
                    </chainedmapper>
                </chainedmapper>
            </pathconvert>
            <echo message="Collected controllers: ${app_controller_names}"/>
    
            <echo message="Injecting into app.js ..."/>
            <replaceregexp file="${app.dir}/app/app.js"
                           match="/\*ant-generated-content-start\*/(.*)/\*ant-generated-content-end\*/"
                           replace="/*ant-generated-content-start*/ ${app_controller_names} /*ant-generated-content-end*/"
                           byline="true"
                    />
        </target>
    
        <target name="-after-build">
            <echo message="Reverting to original app.js ..."/>
            <replaceregexp file="${app.dir}/app/app.js"
                           match="/\*ant-generated-content-start\*/(.*)/\*ant-generated-content-end\*/"
                           replace="/*ant-generated-content-start*/ /*ant-generated-content-end*/"
                           byline="true"
                    />
        </target>
    
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.