0
votes

I’ve added a NavigationView and within it added List. Now on list itemtap setting panel title like as:

var view = Ext.getCmp(‘MyPanel’);
if(!view)
    view = Ext.create('MyApp.view.'+record.data.ScreenId,{title: ‘Tension’});
view.setTitle(‘Tension’); // problem
navigationView.push(view);

But it does not working so let me know what is correct way to perform this task.

Any help is appreciated!!

1
You don't have to use setTitle since you already set the title in the config object when your create the view. Does it not work ?Titouan de Bailleul
Basically 'MpPanel' form is already created. So in that case if condition block will not execute, so I'm setting setTitle in next line but it does not work.Arun Singh
I don't think Panel has setTitle method: docs.sencha.com/touch/2.2.1/#!/api/Ext.Panelsha
@ArunSingh in MyPanel you added titlebar.. is it?Viswa

1 Answers

0
votes

As far as my understanding, you have a panel called "MyPanel" and you added titlebar in it.

In this case you can't directly change the MyPanel title, so you need to get the titleBar from MyPanel and then use setTitle Method. (For your info titleBar has setTitle method).

var view = Ext.getCmp(‘MyPanel’);

var MyPanelTitleBar = view.getComponent('MyPanelTitleId'); // you need to set itemId (MyPanelTitleId) to titleBar.

if(!view)
    view = Ext.create('MyApp.view.'+record.data.ScreenId,{title: ‘Tension’});
MyPanelTitleBar.setTitle(‘Tension’); // not a problem anymore