Extjs 4.1-如何在initComponent函数中创建项

Extjs 4.1-如何在initComponent函数中创建项,extjs,extjs4.1,Extjs,Extjs4.1,我有一个像这样的面板 var filterPanel = Ext.create('Ext.panel.Panel', { bodyPadding: 5, width: 300, myValue:5, title: 'Filters', initComponent: function() { this.items = [{ xtype: 'textfield',

我有一个像这样的面板

 var filterPanel = Ext.create('Ext.panel.Panel', {
        bodyPadding: 5,
        width: 300,
        myValue:5,
        title: 'Filters',
        initComponent: function() {
            this.items = [{
                xtype: 'textfield',
                value: this.myValue
            }];
            this.callParent();
        }
        renderTo: Ext.getBody()
    }); 
我尝试创建一个具有
xtype:'textfield'
的项目,其值为面板的
myValue
。但这是失败

怎么做谢谢。
下面是我的示例文本

您正在使用
Ext.create()
函数,该函数用于创建类的实例<当使用
Ext.define()
函数定义类时,可以使用code>initComponent方法,我不确定
initComponent
函数使用
Ext.create()
方法将不起作用

例如,参见下面的代码,它将得到执行:

Ext.define('customPanel', {
        extend: 'Ext.panel.Panel',
        bodyPadding: 5,
        width: 300,
        myValue:5,
        title: 'Filters',
        initComponent: function() {
            this.items = [{
                xtype: 'textfield',
                value: this.myValue
            }];
            this.callParent(arguments);
        },
        renderTo: Ext.getBody()
    }); 

Ext.create('customPanel');