ExtJs 4 MVC Application Architecture: How to reference a file in a subfolder
I'm trying to use this structure on a p开发者_C百科roject:
- app > view > MyWindow1.js
- app > view > MyWindow2.js
- app > view > ui > MyWindow1.js
- app > view > ui > MyWindow2.js
However, if I want to insert a subfolder, like:
- app > view > window3 > MyWindow3.js
I don't know how to reference it.
In my app.js, I can reference MyWindow1 and MyWindow2 by:
var win1 = Ext.create('MyApp.view.MyWindow1'); var win2 = Ext.create('MyApp.view.MyWindow2');
But, how can I reference MyWindow3?
I tried
var win3 = Ext.create('MyApp.view.window3.MyWindow3');
, but no success.
If your application name
is MyApp
and your appFolder
is app, then Ext.create('MyApp.view.window3.MyWindow3');
is correct. Check the define clause and make sure it is all spelled correctly, and also make sure the spelling and capitalization matches in both the define and the folder. IE: Ext.define('MyApp.view.window3.MyWindow3', //....
The errors for misspellings in either case is very vague, but you will come to recognize it.
精彩评论