Extパネルがあり、いくつかの変数からパネルのタイトルを設定したいと思います。
パネルのを持っているので、id
そこからパネルのタイトルを設定する必要があります。
私はこのようなものを探しています、
Ext.getCmp('myPanel').setTitle();
アトリビュートのように
Ext.define('Myapplication.view.Contacts', {
extend: 'Ext.Panel',
alias: 'widget.Contacts',
id: 'myPanelID',
----
-----
------
-----
listeners: [
{
fn: 'initComponent',
event: 'initialize'
}
]
},
initComponent: function(component, options, wstitle) {
Ext.getCmp('myPanelID').header.title = ('Title of panel'); //Not working
Ext.getCmp('myPanelID').setTitle= ('Title of panel'); //Not working
}
常にエラーが発生しました:
TypeError:'undefined'はオブジェクトではありません('Ext.getCmp(' myPanel')。setTitle'を評価しています)