1. #1
    Sencha User
    Join Date
    Apr 2010
    Posts
    25
    Vote Rating
    0
    Oliver Specht is on a distinguished road

      0  

    Default Answered: Where does require look for files?

    Answered: Where does require look for files?


    Hi,
    I wonder where the Ext.require function looks up the JS files to load?

    Is searched the documentation, docs and forum but did not find any answer.

    Can anyone help me out? Do I need to stick to the proposed app structure?

    Thanks!

    Oliver

  2. Your java-script files and directory structure must follow the Sencha naming convention.
    i.e. the class name matches the directory structure

    e.g. MyApp.desktop.view.MainWindow

    App path as defined with loader -> Desktop folder -> view folder -> Javscript file named MainWindow.js

  3. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    115
    Answers
    346
    vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold

      0  

    Default


    Ext.Loader will look for class files basing on the path of namespace that is set by using Ext.Loader.setPath(). You can also set path for namespaces by using Ext.Loader.setConfig().

  4. #3
    Sencha User
    Join Date
    Apr 2010
    Posts
    25
    Vote Rating
    0
    Oliver Specht is on a distinguished road

      0  

    Default


    Does this require to have the standard app folder structure and only work for applications written in MVC architecture?

    So, as an example, is it possible to define some folders where to look up scripts? Something like:

    - app
    - data
    - ext
    - myscripts

    Thanks,
    Oliver

  5. #4
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    115
    Answers
    346
    vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold

      0  

    Default


    It is applied for all kind of applications basing on Ext framework.

  6. #5
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    465
    Vote Rating
    69
    Answers
    21
    suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice

      0  

    Default


    Your java-script files and directory structure must follow the Sencha naming convention.
    i.e. the class name matches the directory structure

    e.g. MyApp.desktop.view.MainWindow

    App path as defined with loader -> Desktop folder -> view folder -> Javscript file named MainWindow.js

  7. #6
    Sencha User
    Join Date
    Apr 2010
    Posts
    25
    Vote Rating
    0
    Oliver Specht is on a distinguished road

      0  

    Default


    @suzuki:

    Thanks! That is exactly the example that I needed to understand

Thread Participants: 2