0

こんにちは、私は sencha を初めて使用します。ここでナビゲーションを試みています。VehicleSubPage1 の 1 つのボタンをクリックすると、AccountInfo に移動しますが、機能していません。ここにコードを書いています。

誰でも私を助けることができます

* VehicleSubPage1 クラス *

Ext.define("myproject.view.VehicleSubPage1", {
    extend: 'Ext.navigation.View',
        xtype:'VehicleSubPage1form',
        requires: [
        'myproject.view.AccountInfo'
        ],

    config: {

                title: 'Account Info',
                iconCls: 'home',
                styleHtmlContent: true,
                scrollable: true,
                items: [
                {
                    xtype: 'button',
                    text: 'Push another view!',
                    handler: function() {
                      view.push({

                         xtype:'AccountInfoform'

                     });
                    }
                }
            ]        
    }

});

AccountInfo クラス

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

                } 
                ]   

    }

});
4

1 に答える 1

0

問題はview、ボタンハンドラーが未定義であることにあるようです。実際に実行したいpushのは、ナビゲーションビューのメソッドを呼び出すことです。したがって、にid属性を追加しVehicleSubPage1、ハンドラーを次のように変更します。

function() {
    var accountInfo = Ext.getCmp('accountInfo'); //assuming you have set the id of VehicleSubPage1 as id: 'accountInfo'
    accountInfo.push({
        xtype:'AccountInfoform'
    });
}
于 2012-06-20T07:44:55.483 に答える