问题
I'm using the component of SenchaTouch NavigationView. The problem I have is I can not define the title of my view dynamically. This is the code I'm using
onMyList: function(dataview, index, target, record, e, options) {
var myScreen = this.getMyScreen();
var model = Ext.getStore('Example').getAt(index);
dataview.up('navSample').config.title = model.data.Nombre;
dataview.up('navSample').push(myScreen);
},
回答1:
First you have to upgrade Sencha Touch to at least 2.0.1. than you could use:
var navbar = navigationView.getNavigationBar();
navbar.setTitle('My cool title');
Cheers, Oleg
来源:https://stackoverflow.com/questions/11818641/how-to-define-dynamically-the-title-in-a-navigationview-on-sencha-touch