Forum /
Ext JS Community Forums 4.x /
Ext: Q&A /
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
Best Answer Posted by
suzuki1100nz
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
Sencha - Community Support Team
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() .
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
Sencha - Community Support Team
It is applied for all kind of applications basing on Ext framework.
Touch Premium Member
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
@suzuki:
Thanks! That is exactly the example that I needed to understand
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us