Sencha touch 2 Sencha Touch 2读取表单数据

Sencha touch 2 Sencha Touch 2读取表单数据,sencha-touch-2,form-data,Sencha Touch 2,Form Data,我正在尝试使用以下代码将输入的数据读取到表单字段中: var formeg = Ext.define('Layouts.view.Form', { extend: 'Ext.Panel', xtype: 'form', requires: [ 'Ext.form.FieldSet', 'Ext.field.Password' ], config: { title: 'Form',

我正在尝试使用以下代码将输入的数据读取到表单字段中:

    var formeg = Ext.define('Layouts.view.Form', {
    extend: 'Ext.Panel',
    xtype: 'form',

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

    config: {
        title: 'Form',
        iconCls: 'user',

        control: {
            'button[action=button_get]': {
                tap: 'response_get'
            }
        },

        items: [
            {
                xtype: 'toolbar',
                title: 'Form Example'
            },
            {
                xtype: 'fieldset',
                title: 'A Form Example ...',

                items: [
                    {
                        xtype: 'textfield',
                        label: 'Name:',
                        name: 'name',
                        value: 'Dr Fraiser Crane'
                    },
                    {
                        xtype: 'textfield',
                        label: 'Email:',
                        name: 'email',
                        value: 'fcrane@kacl.org'
                    },
                    {
                        xtype: 'passwordfield',
                        label: 'Password:',
                        name: 'password',
                        value: 'imlistening'
                    },
                    {
                        items: [
                            {
                                xtype: 'toolbar',
                                items: [
                                    {
                                        xtype: 'button',
                                        text: 'Set Data',
                                        handler: function(){
                                            Ext.Msg.alert('Set');
                                        }
                                    },
                                    {
                                        xtype: 'button',
                                        text: 'Get Data',
                                        action: 'button_get',
                                        /*handler: function(){
                                            // Ext.Msg.alert('Get: ' + values);
                                        }*/
                                    },
                                    {
                                        xtype: 'button',
                                        text: 'Clear Data',
                                        handler: function(){
                                            Ext.Msg.alert('Cancel');
                                        }
                                    }
                                ]
                            }
                        ]
                    }//buttons
                ]
            }//fieldset
        ]

    },//config

    response_get: function(event){
        var values = formeg.getValues();
        Ext.Msg.alert('Get button responding');
        console.log('Testing GET button response: ' + values);
    }

});
我试图完成的只是使用我的response_get函数打印表单字段中的数据,但出现以下错误:

Uncaught TypeError: Object function () {
                return this.constructor.apply(this, arguments);
            } has no method 'getValues' 

答案是

扩展Ext.form.Panel而不是Ext.Panel