如何动态设置面板导航栏的标题

use*_*472 1 extjs sencha-touch sencha-touch-theming sencha-touch-2

我已经在sencha touch中实现了我的应用程序

在我的面板中,我有一个导航栏,我想在面板标题上动态设置标题

在此输入图像描述

 Ext.define('FleetSyncApp.view.WSMachineTypes', {

        extend: 'Ext.Panel',
        alias: 'widget.wsmachinetypes',
          id: 'myPanel',


    config: {
        layout: {
                   type: 'vbox'
                },

        items: [


            {
                title: 'Contact information',
                xtype: 'list',

----
----
-----


    }
],
    listeners: [
                {
                    fn: 'initComponent',
                    event: 'initialize'
                }
                ]
},
Run Code Online (Sandbox Code Playgroud)

并在initcomponent方法实现代码来获取这样的组件

    initComponent: function(component, options, wstitle) {


           var bar = Ext.getCmp('myPanel');
}
Run Code Online (Sandbox Code Playgroud)

ble*_*enm 7

这应该工作

bar.getParent().getNavigationBar().setTitle('Your Title');
Run Code Online (Sandbox Code Playgroud)