forum

Home / DeveloperSection / Forums / How to get data from fieldset in Sencha Touch 2?

How to get data from fieldset in Sencha Touch 2?

Anonymous User431531-May-2013
Hi Expert!

I hava a fieldset in Sencha Touch 2 as follows:
{
                    id:'contactForm',
                    xtype: 'fieldset',
                    title: 'Information',
                    items: [
                        {
                            xtype: 'textfield',
                            label: 'First Name',
                            placeHolder: 'Your First Name',
                            name:'firstName',
                            id:'firstName',
                        },
                        {
                            xtype: 'textfield',
                            label: 'Last Name',
                            placeHolder: 'Your Last Name',
                            name:'lastName'
                        },
                        {
                            xtype: 'emailfield',
                            label: 'Email',
                            placeHolder: 'email@example.com'
                        },
                        {
                            xtype: 'button',
                            height: 37,
                            style: 'margin-left:35%',
                            width: 100,
                            iconAlign: 'center',
                            text: 'Submit',
                            action:'ContactSubmit'                        
                        },
                        {
                            xtype: 'hiddenfield',
                            id: 'HNumberOfBedRoom',
                            value:'2'
                        },
                        {
                            xtype: 'hiddenfield',
                            id: 'HPetFriendlyId',
                            value:'2'
                        }                
                ]
}

In my controller, I have the following:
refs: { contactForm: '#contactForm' }

I can retrive the value by using

var frmItems=this.getContactForm().getItems();
console.log(frmItems.items[1]._value);

This works fine but i want to retrieve the values something like

frm.get('name/id of component')

Is there any way to achieve this?

Thanks in advance! 


Updated on 01-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By