Sencha touch 森查:可以';t调用方法";更新;未定义的

Sencha touch 森查:可以';t调用方法";更新;未定义的,sencha-touch,Sencha Touch,在这里,我正在注册我的应用程序: App = new Ext.Application({ name: "App", launch: function() { this.views.viewport = new this.views.Viewport(); } }); 这是我注册新面板和组件的方式。我将它们分别放入单独的js文件中 App.views.Viewport = Ext.extend(Ext.TabPanel, { fullscreen: true,

在这里,我正在注册我的应用程序:

App = new Ext.Application({
  name: "App",

  launch: function() {
    this.views.viewport = new this.views.Viewport();
  }
});
这是我注册新面板和组件的方式。我将它们分别放入单独的js文件中

App.views.Viewport = Ext.extend(Ext.TabPanel, {
    fullscreen: true,

    tabBar: {
      dock: 'bottom',
      layout: {
        pack: 'center'
      }
    },

    items: [
      {
        xtype: 'cPanel'
      },
      {
        xtype: 'anotherPanel'
      }
    ]
});

// register this new extended type
Ext.reg('App.views.viewport', App.views.Viewport);
我以同样的方式添加了其他组件

在一个“我的组件”列表视图中,我想在点击某个项目时用另一个面板更改容器面板的activeItem,如下所示:(视口包含此容器面板)

但它说:不能调用未定义的“update”方法

我尝试了不同的变化,比如: App.detailPanel.update(记录数据); 我尝试给出detailPanelcPanelID,它们被添加到容器面板中,并尝试使用Ext.get()访问它们,但这些都不起作用

这里有什么问题

如有其他建议,我们将不胜感激。
谢谢。

懒惰的方法:给面板ID并使用:

Ext.getCmp(id)
建议的方法:将itemId分配给面板并使用:

App.views.viewport.getComponent(itemId)
这将允许您在给定的时间拥有同一组件的多个实例,第一个示例无效,因为您在DOM树中只能有一个单一id

此外,getComponent仅适用于存储在items集合中的组件

App.views.viewport.getComponent(itemId)