Sencha touch FormPanel getValues()无法处理sencha touch2中的按钮点击事件?

Sencha touch FormPanel getValues()无法处理sencha touch2中的按钮点击事件?,sencha-touch,sencha-touch-2,Sencha Touch,Sencha Touch 2,我创建了一个FormPanel表单,用于提交数据库中的一些记录。 FormPanel代码: Ext.define('MyApp.view.NIForm', { extend: 'Ext.form.Panel', config: { id: 'NIForm', items: [ { xtype: 'panel', items: [

我创建了一个FormPanel表单,用于提交数据库中的一些记录。 FormPanel代码:

Ext.define('MyApp.view.NIForm', {
    extend: 'Ext.form.Panel',
    config: {
        id: 'NIForm',
        items: [
            {
                xtype: 'panel',
                items: [
                    {
                        xtype: 'textfield',
                        docked: 'left',
                        id: 'ORDNUM_39',
                        width: '95%',
                        label: 'Order#',
                        name: 'ORDNUM_39'
                    },
                    {
                        xtype: 'button',
                        docked: 'right',
                        itemId: 'browseOrder',
                        width: '5%',
                        text: '...'
                    }
                ]
            },
            {
                xtype: 'textfield',
                id: 'DESC',
                style: 'margin-top:2px;',
                label: 'Description',
                name: 'DESC'
            },
            {
                xtype: 'numberfield',
                id: 'TNXQTY_39',
                style: 'margin-top:2px;',
                label: 'Quantity',
                name: 'TNXQTY_39'
            },
            {
                xtype: 'panel',
                items: [
                    {
                        xtype: 'textfield',
                        docked: 'left',
                        style: 'margin-top:2px;',
                        width: '95%',
                        label: 'GL Code',
                        name: 'GLREF_39'
                    },
                    {
                        xtype: 'button',
                        docked: 'right',
                        width: '5%',
                        text: '...'
                    }
                ]
            },
            {
                xtype: 'textfield',
                id: 'REFDSC_39',
                style: 'margin-top:2px;',
                label: 'Reference',
                name: 'REFDSC_39'
            },
            {
                xtype: 'button',
                action: 'niProcess',
                itemId: 'mybutton3',
                style: 'margin-top:6px;',
                ui: 'confirm',
                text: 'Process'
            }
        ],
        listeners: [
            {
                fn: 'onBrowseOrderTap',
                event: 'tap',
                delegate: '#browseOrder'
            }
        ]
    }
});
现在,我想在ProcessButtonTap事件中获取所有textfields值,以获取我在下面代码行中编写的formpanel值

var me = this;
var form = this.getNIForm();
var values = form.getValues();
var record = form.getRecord();

你能告诉我我做错了什么吗?请解释。

添加了另一个侦听器,它似乎工作正常

listeners: [{
    fn: function () {
        console.info('sdfsd');
    },
    event: 'tap',
    delegate: '#browseOrder'
}, {
    fn: function () {
        console.info(this.getValues());
    },
    event: 'tap',
    delegate: '#mybutton3'
}]

如果要检索特定的文本字段值,请使用

Ext.getCmp('ORDNUM_39').getValue()


要获取所有表单字段值,可以使用

var form=this.getNav()


//如果您控制器中的参考名称为nav,则感谢它为特定文本字段工作,但我必须做的是获得所有表单字段的值。