Sencha touch 2 Sencha skeleton应用程序没有路由器

Sencha touch 2 Sencha skeleton应用程序没有路由器,sencha-touch-2,Sencha Touch 2,我对森查很陌生,从今天开始。我有一个基于我使用“sencha generate app”命令创建的框架应用程序的简单应用程序 在我添加用于登录的控制器之前,一切正常。部署和运行应用程序时,我收到以下错误: Uncaught TypeError: Object #<Object> has no method 'getRouter' Controller.js:476 Ext.define.applyRoutes Controller.js:476 setter sencha-touch

我对森查很陌生,从今天开始。我有一个基于我使用“sencha generate app”命令创建的框架应用程序的简单应用程序

在我添加用于登录的控制器之前,一切正常。部署和运行应用程序时,我收到以下错误:

Uncaught TypeError: Object #<Object> has no method 'getRouter' Controller.js:476
Ext.define.applyRoutes Controller.js:476
setter sencha-touch.js:5441
Base.implement.initConfig sencha-touch.js:4882
Ext.define.constructor Controller.js:386
Class sencha-touch.js:5170
(anonymous function)
Ext.ClassManager.instantiate sencha-touch.js:6749
Ext.ClassManager.instantiateByAlias sencha-touch.js:6661
Ext.apply.factory sencha-touch.js:9779
Ext.define.factoryItem Container.js:609
Ext.define.add Container.js:682
Base.implement.callOverridden sencha-touch.js:4734
etc......
我已经在App.js中指定了控制器

views : ['Main', 'Home', 'Contact', 'Login', 'CreateAccount'],
controllers : ['LoginController'],
这是控制器:

Ext.define("MyApp.controller.LoginController", {
extend : "Ext.app.Controller",

xtype : 'logincontroller',

config : {
    refs : {
        loginForm : "#loginFormPanel"
    },
    control : {
        'button[action=login]' : {
            tap : "authenticateUser"
        }
    },
    views : ['Login']
},

authenticateUser : function(button) {

    this.getLoginForm().submit({
        url : 'php/process_login.php',
        method : 'POST',
        success : function(form, result) { debugger;
            var jsonoutput = Ext.decode(result);
            // json parsing
            Ext.MessageBox.alert('Error', "Success");

        },
        failure : function(form, result) {//This block of code is not executing even after JSON response
            Ext.MessageBox.alert('Error', "Invalid username/password");
        }
    });
}
}))

登录表单

Ext.define('MyApp.view.Login', {
extend : 'Ext.form.Panel',
id : 'loginFormPanel',
xtype : 'loginform',

requires : ['Ext.form.FieldSet', 'Ext.field.Password'],

config : {
    title : 'Login',
    iconCls : 'login',
    items : [{
        xtype : 'fieldset',
        title : 'Logingegevens',
        items : [{
            xtype : 'textfield',
            name : 'username',
            label : 'Gebruikersnaam'
        }, {
            xtype : 'passwordfield',
            name : 'password',
            label : 'Wachtwoord'
        }]
    }, {
        xtype : 'button',
        text : 'Login',
        id : 'loginButton',
        ui : 'action',
        action : 'login'
    }]
}
}))

谢谢你的帮助,
Coen

您没有在控制器的配置中指定任何路由。看看Sencha的路线图

...
config: {
    routes: {
        ...
    },

    refs: {
        ...
     }
},
...

您没有在控制器的配置中指定任何路由。看看Sencha的路线图

...
config: {
    routes: {
        ...
    },

    refs: {
        ...
     }
},
...

谢谢,我在开始时添加了一些路由,但这似乎也不起作用,现在它起作用了:)谢谢,我在开始时添加了一些路由,但这似乎也不起作用,现在它起作用了:)