Swar
Swar

Reputation: 5503

Sencha Touch generate app command : Windows

Do you know how to generate the application structure in Sencha Touch in Windows? I downloaded the Sencha Touch SDK and installed it. The command for generating the app should be:

./sencha generate app Contacts ../contacts

First of all this "." is not recognized in windows. Then I tried this :

sencha generate app Contacts ../contacts

This does nothing, no error, no output. I followed this discussion too. But I couldn't make it work in Windows. Can anyone tell me how to generate full app structure in Sencha Touch?

There is a good video presentation on the topic here. But that too didn't help. May be I am missing something.

Any help?

Upvotes: 0

Views: 3068

Answers (3)

Elian
Elian

Reputation: 323

I know this is a pretty old question. But i had the same prob and did not find any complete reply. So here is my workaround

Let's say (installFolder) is the folder in which you installed your Sencha SDK

  1. copy (installFolder)\command\vendor\nodejs\win\node.exe into the install folder (installFolder)
  2. open a dos session
  3. cd (installFolder)
  4. set NODE_PATH=(installFolder)\command\vendor\nodejs\node_modules
  5. node (installFolder)\command\sencha.js app create --name=(appName) --path=../(appName) --libray=all

Hope this helps !

Upvotes: 0

Dawesi
Dawesi

Reputation: 421

theres a mod for windows on the forums here:

http://www.sencha.com/forum/showthread.php?120667-Sencha-Command-for-Windows&p=611820&viewfull=1#post611820

also remember after you create the app to change to the app directory to issue controller/model/view commands

Upvotes: 0

Chris Farmiloe
Chris Farmiloe

Reputation: 14175

Although the command exists, AFAIK it is not actually supported or documented yet and as such should not really be expected to actually work. In fact I think it's a bit out of date.

If it helps, here's the general structure I use to layout my apps:

app.js

Ext.regApplication({
    name: 'app',
    launch: function() {
        // setup main view
        this.viewport = new app.ApplicationViewport();
    }
});

app/views/Viewport.js

app.views.ApplicationViewport = Ext.extend(Ext.Panel,{
    title: 'YourApp',
    layout: 'card',
    initComponent: function(){
        // main view setup code
        Ext.apply(this, {
            items: [new app.views.YourModelViewport()]
        })
        // super
        app.CustomersViewport.superclass.initComponent.apply(this, arguments);
    }
});

app/models/YourModel.js

app.models.YourModel = Ext.regModel("YourModel", {
    fields: [
        // field config
    ],

    validations: [
        // validation configs
    ],

    proxy: {
        // proxy configs
    }
});

app/stores/YourModelStore.js

app.stores.YourModelStore = new Ext.data.Store({
    model: 'YourModel'
});

app/view/YourModel/Viewport.js

app.views.YourModelViewport = Ext.extend(Ext.Panel,{
    title: 'YourModel',
    layout: 'card',

    initComponent: function(){
        // view setup code
        this.html = 'A Viewport';
        // super
        app.CustomersViewport.superclass.initComponent.apply(this, arguments);
    }
});

app/controllers/YourModelController.js

Ext.regController("YourModelController", {
    show: function(o) {
        // some controller code
    }
});

Upvotes: 3

Related Questions