Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: understanding Ext.Loader.setPath('Ext.ux', '../ux/');

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    92

    Default understanding Ext.Loader.setPath('Ext.ux', '../ux/');

    Hi there,
    I'm trying to implement the Status bar and I think I've got a prob' with the following:
    Code:
         Ext.Loader.setConfig({
         enabled: true
     });
    
     Ext.Loader.setPath('Ext.ux', '../ux/');
    I'm not quite sure what it does and I would really appreciate if some one can help me with this.
    Many thanks
    mkariti

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

    Default

    It allows Ext.Loader to be able to resolve the relative path for all the Ext.ux.* classes
    Mitchell Simoens @LikelyMitch

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

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

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    92

    Default

    Hi mitchellsimoens,
    Do I have to use the Loader in order to implement the status bar?
    Is there a chance it conflicts with other JS file as when tried to impliment it, the other forms wont rendered.
    cheers

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    The only time you want to use Ext.Loader is if you want to load a class dynamically... like if the JS file isn't loaded already. Also, Ext.Loader is a development tool only meant to be replaced once you run the SDK tools.
    Mitchell Simoens @LikelyMitch

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

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

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    92

    Default

    So what do I need to put instead of this:
    Sorry but still abit confused as what is the purpose of this.
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    Ext.Loader.setPath('Ext.ux', '../ux/');
    thanks

  6. #6
    Sencha User
    Join Date
    Feb 2008
    Location
    New York, USA
    Posts
    218

    Default

    If you don't want to use the Loader just import your script with the traditional script tag, for example:

    HTML Code:
    <script src="js/ext/ux/grid/Printer.js"></script>
    Regards

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    92

    Default

    Hi crysfel,
    So the Loader basically includes all the files under the ux folder dynamically?
    Is there any other way to include all files as I undestand that the loader is only for development purposes only.
    Cheers


  8. #8
    Sencha User
    Join Date
    Feb 2008
    Location
    New York, USA
    Posts
    218

    Default

    So the Loader basically includes all the files under the ux folder dynamically?
    Yeah, that's true.

    This:
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    Ext.Loader.setPath('Ext.ux', '../ux/');
    
    Ext.require("Ext.ux.grid.Printer"); //import the Printer class
    is the same as this:
    Code:
    <script src="js/ext/ux/grid/Printer.js"></script>
    As @mitchellsimoens said, use Ext.Loader is if you want to load a class dynamically.

    Is there any other way to include all files as I undestand that the loader is only for development purposes only.
    You should use the "Sencha Command", is a tool to compress all your JS's files, you can download from here: http://www.sencha.com/products/jsbuilder

    Regards

  9. #9
    Sencha User
    Join Date
    Aug 2011
    Posts
    92

    Default

    Many thanks for both of you.
    I will definitely check it out!

  10. #10

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Also, Ext.Loader is a development tool only meant to be replaced once you run the SDK tools.
    Does that mean the SDK tools will replace it automatically if you use "sencha create ..." + "sencha build ..." or does this mean I am supposed to replace this with something before I use the SDK tools?

    I am asking because I am running into trouble with my minimized app and I am trying to see if this is the problem.

Page 1 of 2 12 LastLast

Posting Permissions

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