12 Feb 2013 6:19 AM #1
How does Sencha Cmd know to pull in requires?
When you run something like, "sencha app build package" for a Touch project, Cmd goes through and pulls in all of the required classes that are needed by the class. For Ext.Application, it even reads the "controllers" and "views" arrays to know to pull those in.
I'm creating another controller that's handling its own views internally and trying to figure out how to tell Cmd to include its dynamically-loaded classes. The view class names are defined in the controller's own mapping object and, in development, loads fine because the controller dynamically calls Ext.require() for any activating view. However, Cmd doesn't know about the class names in the calls to Ext.require because they're dynamic (i.e., variable). Is there a way to tell Cmd to look into the controller's mapping file to also include additional classes?
13 Feb 2013 8:59 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
The views, are they required anywhere or are required when you create an instance?Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
15 Mar 2014 8:45 AM #3
I have problems with "views" coming from an application that was build without Sencha Cmd.
I normally reference all the needed views by controller in the controller's views section and this works perfectly with the Ext.Loader. Now when using SenchaCMD it seems it only follows requirements in the requires section. Why ? And is there a way around? Or do I have to move all my view refrerences into a requirement section? Like this...
views: [ 'app.LanguageSwitcherButton', 'app.LanguageSwitcherCombo' ]
requires: [ 'NAMESPACE.view.app.LanguageSwitcherButton', 'NAMESPACE.view.app.LanguageSwitcherCombo' ]
15 Mar 2014 8:58 AM #4
Ok, from the docs it says:
The compiler understands these "keywords" of this declarative language: