[英]Uncaught TypeError: Object #<Object> has no method 'getValue'
[英]Uncaught TypeError: Object [object Object] has no method 'onAdded'
我将ExtJS4与Java servlet一起使用。 我正在使用ExtJS的MVC体系结构。 我正在尝试显示边框布局的简单示例,但是它不起作用,并且在javascript控制台的ext-all.js中收到以下错误:
未捕获的TypeError:对象[object Object]没有方法'onAdded'
这是我的代码:
app.js
Ext.Loader.setConfig({
enabled : true
});
Ext.application({
name : 'IN',
appFolder : 'app',
controllers : [ 'Items' ],
launch : function() {
console.log('in LAUNCH-appjs');
Ext.create('Ext.container.Viewport', {
items : [ {
xtype : 'borderlyt'
} ]
});
}
});
Items.js(控制器)
Ext.define('IN.controller.Items', {
extend : 'Ext.app.Controller',
views : [ 'item.Border' ],
init : function() {
this.control({
'viewport > panel' : {
render : this.onPanelRendered
}
});
},
onPanelRendered : function() {
console.log('The panel was rendered');
}
});
Border.js(查看)
Ext.define('IN.view.item.Border',{extend : 'Ext.layout.container.Border',
alias : 'widget.borderlyt',
title : 'Border layout' ,
autoShow : true,
renderTo : Ext.getBody(),
defaults : {
split : true,
layout : 'border',
autoScroll : true,
height : 800,
width : 500
},
items : [ {
region : 'north',
html : "Header here..",
id : 'mainHeader'
}, {
region : 'west',
width : 140,
html : "Its West..",
}, {
region : 'south',
html : "This is my temp footer content",
height : 30,
margins : '0 5 5 5',
bodyPadding : 2,
id : 'mainFooter'
}, {
id : 'mainContent',
collapsible : false,
region : 'center',
margins : '5',
border : true,
} ]
});
Webcontent的文件夹结构如下:
有人可以帮助我解决此错误吗?
提前致谢
Ext.define不得包含配置选项renderTo
。 加载组件后,主体可能仍然不存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.