开发者

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 thi开发者_JAVA技巧s :

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?


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
    }
});


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


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 !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜