Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ExtJS未捕获类型错误-需要一个简单的解决方案。已知问题的解决方法_Extjs_Extjs4_Sencha Touch 2_Sencha Architect - Fatal编程技术网

ExtJS未捕获类型错误-需要一个简单的解决方案。已知问题的解决方法

ExtJS未捕获类型错误-需要一个简单的解决方案。已知问题的解决方法,extjs,extjs4,sencha-touch-2,sencha-architect,Extjs,Extjs4,Sencha Touch 2,Sencha Architect,由于某些已知问题,在extjs中将组件添加到视口中似乎是个问题 理想是: var paneltab = Ext.create('ROMLProjectAdmin.view.MainTabPanel'); Ext.getCmp('loginregister').destroy(); Ext.Viewport.add(paneltab); 出现以下错误: Uncaught TypeError: Object function constructor(){ // Opera has some p

由于某些已知问题,在extjs中将组件添加到视口中似乎是个问题 理想是:

var paneltab = Ext.create('ROMLProjectAdmin.view.MainTabPanel');
Ext.getCmp('loginregister').destroy();
Ext.Viewport.add(paneltab);
出现以下错误:

Uncaught TypeError: Object function constructor(){
  // Opera has some problems returning from a constructor when Dragonfly isn't running. The || null seems to
  // be sufficient to stop in misbehaving. Known to be required against 10.53, 11.51 and 11.61.
  return this.constructor.apply(this, arguments) || null;
} has no method 'add'
这解释了发生了什么,但我不完全理解如何使用“refs”实现建议的解决方案,因为我是一个新手。我想知道是否有人能给我一个更简单的解释

或者,根据上面失败的代码,是否有人能给我一个启动选项卡面板的替代方法(在这种情况下,用户登录,屏幕结束,现在打开主选项卡)

提前谢谢

Kevin

只是,您需要该类的实例,以便向其添加组件:

Ext.create('Ext.container.Viewport', {
    id: 'myviewport'
});

var paneltab = Ext.create('ROMLProjectAdmin.view.MainTabPanel');
Ext.getCmp('loginregister').destroy();
Ext.getCmp('myviewport').add(paneltab);