0
votes

I’ve created a FormPanel form for submitting some record in our database. FormPanel Code:

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'
            }
        ]
    }
});

Now I want to get all textfields value on process button tap event, To get the formpanel value I've written following line of code.

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

Can you tell me what am I doing wrong? Please explain.

3

3 Answers

0
votes

Added another listener and it seems to work fine.

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

Here is the fiddle

0
votes

If you want to retrieve particular TextField value use

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

0
votes

To get all form field values u can use like,

var form = this.getNav();

//if ur ref name inside ur controller is nav