Results 1 to 3 of 3

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

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Vote Rating

    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.

        <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:


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


    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

         * 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": "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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    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
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Vote Rating


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

      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
    Director of Engineering - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "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