Results 1 to 6 of 6

Thread: Where does require look for files?

  1. #1
    Sencha User
    Join Date
    Apr 2010
    Posts
    26
    Vote Rating
    0
      0  

    Default 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 User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    114
      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
    26
    Vote Rating
    0
      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 User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347
    Vote Rating
    114
      0  

    Default

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

  6. #5
    Sencha Premium User suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    714
    Answers
    45
    Vote Rating
    234
      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
    26
    Vote Rating
    0
      0  

    Default

    @suzuki:

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

Posting Permissions

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