Results 1 to 3 of 3

Thread: Commad Sencha Generate with namespace

  1. #1
    Sencha User relson's Avatar
    Join Date
    Dec 2011
    So Paulo, SP, Brasil
    Vote Rating

    Lightbulb Commad Sencha Generate with namespace

    How can I do to generate model/controller with namespace like...

    sencha generate model admin.User
    and then have a folder structure

         |_ /admin
    on current version I have the outputed a file with dot separated admin.User.js in folder model
    Last edited by relson; 23 Mar 2012 at 9:21 AM. Reason: Formatting to let more clear

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    The issue is that the folder structure doesn't adhere to the dot notation namespace but the name of the model is correct right?

    I can see the model having the right name but the path doesn't look like it supports this:

    this.template('model.js', path.join('app', 'model', + '.js'));
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    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.

    Need more help with your app? Hire Sencha Services

    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
    Touch Premium Member
    Join Date
    Sep 2011
    Vote Rating


    It seems like sencha CMD expects all models to be in the "model" directory and when used in store it should be like:

    model: 'ModelName' #which translates to App.model.ModelName

    so far so good, but if i want to specify the model name like this:
    model: 'App.model.ModelName'
    sencha cmd will translate this to App.model.App.model.ModelName and the file will not be found.

    This is very useful when you have multiple apps like Core, App1, App2 and App1, App2 stores use the model definitions from Core.
    While in browser this works fine, sencha cmd does not understand this.

    Is there a way around this?
    Is it possible to modify that line which generates the filepath for models? Can we dig somewhere in sencha cmd and modify it on our one so that when contains a dot, consider it the full class name and not append the current applucation namespace.

    Thank you

Posting Permissions

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