1.TypeError: this.addEvents is not a
function
var win = new
Ext.Window({
id:'my first window',
title:'my first extjs window',
width:300,
height:400,
layout:'fit',
autoLoad:{
url:'sayHi.html',
scripts:true
}
});
win.show();
this.addEvents is not a function 错误主要是由于没有new
引起的,小心检查一下是否在创建对象的时候忘记写new了?比如:
function buildWindow(){
}
Ext.onReady(buildWindow);
在第一行的时候如果没有写new就会出现这样一个错误!
2.
本文详细解析了在使用Ext.js库时遇到的this.addEventsisnotafunction错误的原因及解决方法,主要关注于确保正确创建对象以避免此类错误。通过实例演示,帮助开发者理解并预防在开发过程中可能遇到的常见问题。
636

被折叠的 条评论
为什么被折叠?



