1. #1
    Ext JS Premium Member itlogo's Avatar
    Join Date
    Mar 2008
    Posts
    37
    Vote Rating
    1
    itlogo is on a distinguished road

      0  

    Default How does Sencha Cmd know to pull in requires?

    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?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,652
    Vote Rating
    901
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The views, are they required anywhere or are required when you create an instance?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    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 services@sencha.com

    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.

  3. #3
    Sencha User
    Join Date
    May 2009
    Posts
    136
    Vote Rating
    5
    DiscoBoy is on a distinguished road

      0  

    Default


    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...

    Code:
    views: [
        'app.LanguageSwitcherButton',
        'app.LanguageSwitcherCombo'
    ]
    into

    Code:
    requires: [
        'NAMESPACE.view.app.LanguageSwitcherButton',
        'NAMESPACE.view.app.LanguageSwitcherCombo'
    ]

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    136
    Vote Rating
    5
    DiscoBoy is on a distinguished road

      0  

    Default


    Ok, from the docs it says:

    The compiler understands these "keywords" of this declarative language:

    • requires
    • uses
    • extend
    • mixins
    • statics
    • alias
    • singleton
    • override
    • alternateClassName
    • xtype
    So now views!? Can you confirm this?

Thread Participants: 2