Results 1 to 3 of 3

Thread: Sencha Cmd: Customize URLs of Ext sources during development

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
      0  

    Default Sencha Cmd: Customize URLs of Ext sources during development

    I generated an ExtJS application stub using Sencha Cmd and now I would like to set it up within a backend server for development. The ExtJS application will be served from within a path such as /static/project/ so I set up my script loading directives accordingly.

    Code:
        <script src="/static/project/ext/ext-dev.js" type="text/javascript" ></script>
        <script src="/static/project/bootstrap.js" type="text/javascript" ></script>
        <script src="/static/project/app/app.js" type="text/javascript" ></script>
    Now, when I try to load the application the loader stops on the first file with a 404 error on an address like this:

    http://server_url/ext/src/app/Application.js

    I want it to look for the sources in this location instead:

    http://server_url/static/project/ext/src/app/Application.js

    It seems that Ext expects its sources to be in a path relative to the page which called it. This is consistent with a Ext.Loader.addClassPathMappings command in bootstrap.js

    Code:
        /**
         * This file is generated by Sencha Cmd and should NOT be edited.  It is 
         * provided to support globbing requires, custom xtypes, and other 
         * metadata-driven class system features 
         */
        Ext.Loader.addClassPathMappings({
          "Ext": "ext/src",
          "Ext.rtl.EventObjectImpl": "ext/src/rtl/EventObject.js",
          "xmin": "app"
        });
    Sencha Cmd tells me NOT to edit this file, so I'm wondering how I can set the project up in such a way, that Sencha Cmd is able to find all files needed for building the application, while I'm still able to use the development version served from a custom URL.

    Which file do I edit to achieve this (sencha.cfg, app.json, etc)? What command do I call after editing them?

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,062
    Vote Rating
    1391
      0  

    Default

    You can try to edit in app.js to add your Ext.Loader.setPath to see how that works. You are just getting outside of what Cmd is aimed to work with.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,742
    Vote Rating
    258
      0  

    Default

    If you run this form does it get the paths correct:

    Code:
      sencha app refresh --base ..
    ?

    The "--base" argument can be used to specify the relative base of your page with respect to the Sencha Cmd application.

    We have an open ticket on this for 3.1.1 to respect this via configuration of the page file location but this might work for you in the interim.
    Don Griffin

    "Use the source, Luke!"

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
  •