How to define dynamically the title in a NavigationView on Sencha Touch?

余生长醉 提交于 2019-12-12 01:48:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!