Results 1 to 6 of 6

Thread: Ext.Loader and CMD

  1. #1

    Default Ext.Loader and CMD

    I've configured Ext.loader in my Application.js, though CMD doesn't seem to understand this configuration:
    Code:
    Ext.Loader.setConfig({
        enabled : true,
        //disableCaching: false,  
        paths : {
            'Ext.ux.callout' : 'app/ux/callout',
            'Ext.ux.container' : 'app/ux/container',
            'Ext.ux.toggleslide' : 'app/ux/toggleslide',
            'Ext.ux.tab': 'app/ux/tab',
            'Ext.ux.form.MultiSelect' : 'app/ux/form/MultiSelect.js',
            'Ext.ux.menu.StoreMenu' : 'app/ux/menu/StoreMenu.js',
            'Ext.data.SimpleStore': 'app/data/SimpleStore.js'
        }
    });
    Ext.Loader.setPath('MyApp', '.');
    as I get a NotFound error
    Code:
    [ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.data.SimpleStore
    This is all Ext 4.2, CMD 5.

    Is there a better way to use the Ext.Loader with a CMD app?

  2. #2
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    The loader configuration is ignored when performing a build. You need to add your app/data/SimpleStore.js to the classpath. Avoiding using the Ext namespace is also a good practice
    Israel Roldán | Senior Software Engineer (Framework tools)

  3. #3

    Default

    Thanks for the response. Can you expand a bit? Would you recommend not using the Ext.Loader at all? When adding to the classpath, use the "JS" array in app.json, correct?

  4. #4
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    27

    Default Appending to the classpath for CMD builds

    My understanding is that the classpath is a CMD configuration i.e. you set it in a sencha.cfg file (either the one under YourApp/.sencha or the workspace configuration under YourWorkspace/.sencha/workspace/sencha.cfg.

    I use the "sencha app watch" web server to serve my dev version of the app and in this mode it appears the Ext.Loader is ignored. So, yes, I think you can ditch the loader if you are doing development in this mode. Otherwise it seems you will have to duplicate the path configurations in the sencha.cfg (for CMD builds) and in Ext.Loader path config (for development).

  5. #5

    Default

    Why would you use the classpath versus adding the classes to a 'requires' or as an included JS reference (index.html/app.json JS array)?

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    27

    Default

    I think requires only finds classes that are in the class path (by default the sdk directory and your application directory). The modules I'm using are outside the default path. As for using app.json, yes that would work but AFAIK that lets you specify individual files, not a whole directory to add to the path.

Tags for this Thread

Posting Permissions

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