¨How set the title to the panel dynamically by getting the panel using its id in inExt.getCmp('myPanelID'), What are the properties to set title
Sencha Touch 2, Sencha Touch, Extjs
I have a Ext panel and I want to set the Title of the panel from some variable .
I have the id
of the panel and I need to set the title of the panel from it.
I am looking for some thing like this,
Ext.getCmp('myPanel').setTitle();
like atribute
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
}
alway got an error:
TypeError: 'undefined' is not an object (evaluating 'Ext.getCmp('myPanel').setTitle')
0
U
user1425472