Reputation: 26598
How can I change listpanel title dynamically? I have a navigationview where listpanel is the item. So the navigation bar display the panel title that i would change dynamically.
image:
Thanks.
listpanel = new Ext.Panel({
layout: 'fit',
id:'listpanel',
title:'change this title dinamically',
items: [
{
xtype: 'titlebar',
id: 'myTitle',
docked: 'top',
title: 'title1'
},
{ xtype: 'titlebar',
id: 'myMeanConsumption',
docked: 'bottom',
title: 'title2'
},
list
]
});
Upvotes: 0
Views: 8658
Reputation: 1
Add this after the listpanel is created:
listpanel.onAfter('painted', function () {
listpanel.getNavigationBar().setTitle(newTitle); }, listpanel, { delay: 100 });
Upvotes: 0
Reputation: 46395
Do like this,
Ext.getCmp('myTitle').setTitle('Changed Title');
EDIT :
title
property is not available on Ext.Panel
component. Hence, the below line is redundant.
title:'change this title dinamically',
You need to change the title
of titlebar
only which I already mentioned above.
I cannot see the listpanel
title.
Upvotes: 1