Skip to content

Instantly share code, notes, and snippets.

@hoverlover
Created August 31, 2012 14:00
Show Gist options
  • Save hoverlover/3553045 to your computer and use it in GitHub Desktop.
Save hoverlover/3553045 to your computer and use it in GitHub Desktop.
Dynamically add fieldset to sencha FormPanel
App.views.creditCardForm.items.items[0].up('form').insert(1, {
xtype: 'fieldset',
id: 'customerInfoFormFieldset',
title: 'Name and Address Details',
instructions: 'Please enter your name and address.',
defaults: {
xtype: 'textfield',
labelAlign: 'left',
labelWidth: '40%',
required: false,
useClearIcon: true,
autoCapitalize : false
},
items: [
{
name : 'name',
label: 'Name',
autoCapitalize : true
},
{
xtype: 'App.views.ErrorField',
fieldname: 'name'
},
{
name : 'address',
label: 'Address'
},
{
xtype: 'App.views.ErrorField',
fieldname: 'address'
},
{
name : 'city',
label: 'City',
autoCapitalize : true
},
{
xtype: 'App.views.ErrorField',
fieldname: 'city'
},
{
name : 'state',
label: 'State',
autoCapitalize : true
},
{
xtype: 'App.views.ErrorField',
fieldname: 'state'
},
{
name : 'zip',
label: 'Zip',
},
{
xtype: 'App.views.ErrorField',
fieldname: 'zip'
}
]
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment