Code:
var _communicateCardFormItems = [{
xtype: 'textfield',
name: 'name',
label: 'Name',
placeHolder: 'John Smith',
autoCapitalize: true,
required: true,
useClearIcon: true
}, {
xtype: 'textfield',
name: 'address',
label: 'Address',
useClearIcon: true
}, {
xtype: 'textfield',
name: 'city',
label: 'City',
placeHolder: 'Calgary',
useClearIcon: true
}, {
xtype: 'textfield',
name: 'postalcode',
label: 'Postal Code',
useClearIcon: true
}, {
xtype: 'textfield',
name: 'phone',
label: 'Phone'
}, {
xtype: 'emailfield',
name: 'email',
label: 'Email'
}, {
xtype: 'checkboxfield',
name: 'updateinfo',
label: 'Update my info',
labelWidth: '80%',
cls: "rpc-checkbox"
}, {
xtype: 'checkboxfield',
name: 'churchdirectory',
label: 'Include info in the church directory',
labelWidth: '80%',
cls: "rpc-checkbox"
}, {
xtype: 'checkboxfield',
name: 'newchristian',
label: 'I asked Jesus to come into my life!',
labelWidth: '80%',
cls: "rpc-checkbox"
}, {
xtype: 'checkboxfield',
name: 'becomechristian',
label: 'I want to become a Christian',
labelWidth: '80%',
cls: "rpc-checkbox"
}, {
xtype: 'fieldset',
defaults: { xtype: 'radiofield', labelWidth: '80%' },
title: 'I am',
items: [{
name: 'maritalstatus',
label: 'married',
value: 'married'
}, {
name: 'maritalstatus',
label: 'Senior (65+)',
value: 'senior'
}, {
name: 'maritalstatus',
label: 'Single Parent',
value: 'single parent'
}, {
name: 'maritalstatus',
label: 'Single Adult (30+)',
value: 'Single Adult'
}, {
name: 'maritalstatus',
label: 'Teen (13-17)',
value: 'Teen'
}, {
name: 'maritalstatus',
label: 'Young Adult (18-29)',
value: 'Young Adult'
}]
}];
rpc.views.Contact.CommunicateCard = {
title: 'Communicate Card',
xtype: 'form',
id: 'rpc-views-contact-communicatecard',
scroll: 'vertical',
fullscreen: true,
standardSubmit: true,
items: [{
xtype: 'fieldset',
title: 'Communicate Card',
instructions: config.CommunicateCardInstructions,
defaults: {
// labelAlign: 'right'
labelWidth: '40%'
},
items: _communicateCardFormItems
}, {
layout: 'vbox',
defaults: { xtype: 'button', flex: 1, style: 'margin: 0em;' },
items: [{
text: 'Submit',
handler: function () {
Ext.getCmp('rpc-views-contact-communicatecard').submit();
}
}]
}]
};
I'd like to post it directly as a form since I can then create a PostModel on my WebService and use the default Model Binder to manipulate the data.