Iam design one formpanel with set of controls in this form panel design textfields like
{
xtype: 'compositefield',
fieldLabel: 'City',
labelAlign: 'left',
id: 'AddEditPeopleCompositeFieldCity',
items: [ 开发者_JAVA百科/* * txtCity * */ ,
{
xtype: 'spacer',
width: 10
}, {
xtype: 'displayfield',
value: 'State:',
style: 'padding-top:3px;',
align: 'bottom'
}, /* * txtState * */ ,
{
xtype: 'spacer',
width: 5
}, {
xtype: 'displayfield',
value: 'Zip:',
style: 'padding-top:3px;',
align: 'bottom'
}, /* * txtZip * */ ]
}
but for this textfields "dataIndex" property not working
Please help me
Thanks in advance
There is no dataIndex
property for compositefields. You need to set name
property for each fields. You can use the getValues()
method available for the form object to get the values.
For details and code example, refer to the Ext JS example that come with the library download.
To load data onto the form you can use the load()
or loadRecord()
method available with the form. Have a look at this example code. Go through the code for button handlers for the form. There is example of both retrieving and set data to composite fields.
精彩评论