Results 1 to 3 of 3

Thread: ExtJS MVC application and loading resources as needed basis

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011

    Default ExtJS MVC application and loading resources as needed basis


    I'm trying to construct MVC application that would load resources only when needed. Now when I've views, stores etc. listed on an application they're loaded at startup - something I though loader would take care of.

    How I can construct my app so that only requested parts are loaded?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    You need to load things up front. If you load them when you need them you will have to load lots of classes which will have bad performance. Having them compiled and minified into one file will perform better.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007


    You can set this before running Ext.Application:

    Using that option, classes will be loaded on demand, as long as you setup the paths correctly. This is great for development and debugging.

    A good way to implement this autoloading approach is to use the property "views" and "stores" of your controllers. Each controller can include its own required classes and even instantiate them. On views you can use "requires".
    A controller can load a Panel. That Panel can require a Grid. And so on.

    Read the MVC Tutorials.

    Those controllers can be loaded as needed using yourapp.getController() method. "yourapp" is the instance of Ext.Application.

    Once you are ready for production deploy, you can turn off autoloading, and create a minified version using Sencha SDK.

    Forget about using auto loading on a production version, specially if it is hosted on the cloud. Your app will be terribly slow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts