Extjs 无法从Ext.navigation.view推送新视图[对象窗口]没有方法';向上';
我在推的时候犯了这个错误Extjs 无法从Ext.navigation.view推送新视图[对象窗口]没有方法';向上';,extjs,navigation,sencha-touch,sencha-touch-2,push,Extjs,Navigation,Sencha Touch,Sencha Touch 2,Push,我在推的时候犯了这个错误 Uncaught TypeError: Object [object Window] has no method 'up' 我的代码 Ext.define('Proj.view.test.Home', { extend: 'Ext.navigation.View', xtype: 'homeTabItem', id: 'home', requires : [], config: { refs:{
Uncaught TypeError: Object [object Window] has no method 'up'
我的代码
Ext.define('Proj.view.test.Home', {
extend: 'Ext.navigation.View',
xtype: 'homeTabItem',
id: 'home',
requires : [],
config: {
refs:{
homeTab:'homeTabItem'
},
title : 'Home',
iconCls: 'home',
scrollable:true,
listeners : {
element : 'element',
scope : this,
delegate : 'div',
tap : function(e) {
e.stopEvent();
console.log(e.target.id);
this.up('homeTabItem').push({
xtype: 'newView'
});
}
}
},
initialize:function(){
Ext.Ajax.request({
url: 'test.html',
method: 'GET',
callback: function(options, success, response) {
Ext.ComponentQuery.query('homeTabItem')[0].setHtml( response.responseText );
}
});
}
})
创建全局变量
var myThis;
在初始化中添加myThis=this代码>
现在,您可以使用myThis来推送视图是否执行此操作。up('homeTabItem')返回导航视图?它应该返回。但是这里我什么都没有得到现在“这个”给出了窗口{displayTabbar:true,cartItemsCount:0,var:Object,top:Window,