Javascript 导航在sencha不起作用

Javascript 导航在sencha不起作用,javascript,sencha-touch,extjs,Javascript,Sencha Touch,Extjs,您好,我是新来sencha的,我正在尝试导航,我单击车辆子页面1中的一个按钮,然后它导航到AccountInfo,但它不工作, 这是我正在写的代码 有人能帮我吗 *车辆子页面1类* AccountInfo类 问题似乎在于按钮处理程序中的视图未定义。实际上,您要做的是调用导航视图的push方法。因此,将id属性添加到VehicleSubPage1并将处理程序更改为以下内容: function() { var accountInfo = Ext.getCmp('accountInfo');

您好,我是新来sencha的,我正在尝试导航,我单击车辆子页面1中的一个按钮,然后它导航到AccountInfo,但它不工作, 这是我正在写的代码

有人能帮我吗

*车辆子页面1类*

AccountInfo类


问题似乎在于按钮处理程序中的视图未定义。实际上,您要做的是调用导航视图的push方法。因此,将id属性添加到VehicleSubPage1并将处理程序更改为以下内容:

function() {
    var accountInfo = Ext.getCmp('accountInfo'); //assuming you have set the id of VehicleSubPage1 as id: 'accountInfo'
    accountInfo.push({
        xtype:'AccountInfoform'
    });
}
Ext.define("myproject.view.AccountInfo", {
    extend: 'Ext.Panel',
        xtype:'AccountInfoform',
    config: {

               url: 'contact.php',
                title: 'Account Info',
                iconCls: 'home',
                styleHtmlContent: true,
                scrollable: true,
                items:[
                 {
                xtype: 'button',
                text: 'send',
                ui: 'confirm',
                handler:function(){
                alert("clicked");
                }

                } 
                ]   

    }

});
function() {
    var accountInfo = Ext.getCmp('accountInfo'); //assuming you have set the id of VehicleSubPage1 as id: 'accountInfo'
    accountInfo.push({
        xtype:'AccountInfoform'
    });
}