开发者

DataIndex property for extjs textfield in compositefield

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜