Sunder
Sunder

Reputation: 1513

Changing an Ext.panel title

I'd like to dynamically set the panel title. And the following doesn't seem to work! Any ideas? Thanks in advance!

Ext.create('Ext.panel.Panel', {
       id: 'p0',
       title: 'Hello World',
       width: 200,
       html: '<p>Lorem ispsum doler sit</p>',
       renderTo: Ext.getBody()
});

Ext.getCmp('p0').title = 'Bye World'; //does not work!    
Ext.getCmp('p0').header.title = 'Bye World'; //does not work either!

Upvotes: 6

Views: 8267

Answers (1)

Abdel Raoof Olakara
Abdel Raoof Olakara

Reputation: 19353

You can simply call the setTitle method available with the Panel class.

panel.setTitle('Bye World');

Sencha Docs is your friend. Read it!!

Upvotes: 8

Related Questions