3

如何从面板获取数据到子项?我在面板的记录属性中有数据,但我想用它来设置字段集中文本字段的值。

Ext.define('My.view.MyDetail', {
extend: 'Ext.Panel',
xtype: 'mydetail',
requires: [        
],

config: {
    refs: {
    },

    title: 'Details',
    styleHtmlContent: true,
    scrollable: 'vertical',

{
    xtype: 'fieldset',
    title: 'About You',
    instructions: 'Tell us all about yourself',
    items: [
        {
            xtype: 'textfield',
            name : 'firstName',
            label: 'First Name',
                            data?, record? how do I get something from this Panel's record?
        },
...
The data is here in this.getData().firstName
    listeners: {
    show: function(list, opts){
        console.log(this.getData().firstName);
    }
}   
});
4

1 回答 1

3

向您的文本字段添加一个 id 使用:Ext.getCmp('yourID').getValue()//获取值 Ext.getCmp('yourID').setValue(this.getData().firstName)//设置值

于 2012-05-17T18:10:45.907 回答