在客户的机器上运行,不管如何操作,都不报错。
但在我自己的笔记本上,用Firefox的错误控制台查看,在ext-2.2\ext-all-debug.js里面报一堆错误
比如:onBeforeAdd : function(item){
if(item.ownerCt){//第14161行,ownerCt为空或不是对象
item.ownerCt.remove(item, false);
}
if(this.hideBorders === true){
item.border = (item.border === true);
}
}
lookupComponent : function(comp){
if(typeof comp == 'string'){
return Ext.ComponentMgr.get(comp);
}else if(!comp.events){//第14183行,events为空或不是对象
return this.createComponent(comp);
}
return comp;
}
getComponentId : function(comp){
return comp.itemId || comp.id;//第14087行,itemId为空或不是对象
}
add : function(comp){
if(!this.items){
this.initItems();
}
var a = arguments, len = a.length;
if(len > 1){
for(var i = 0; i < len; i++) {
this.add(a[i]);
}
return;
}
var c = this.lookupComponent(this.applyDefaults(comp));
var pos = this.items.length;
if(this.fireEvent('beforeadd', this, c, pos) !== false && this.onBeforeAdd(c) !== false){
this.items.add(c);
c.ownerCt = this;//第14111行,ownerCt为空或不是对象
this.fireEvent('add', this, c, pos);
}
return c;
}
doLayout : function(shallow){
if(this.rendered && this.layout){
this.layout.layout();
}
if(shallow !== false && this.items){
var cs = this.items.items;
for(var i = 0, len = cs.length; i < len; i++) {
var c = cs[i];
if(c.doLayout){//第14120行,doLayout为空或不是对象
c.doLayout();
}
}
}
}
但在我自己的笔记本上,用Firefox的错误控制台查看,在ext-2.2\ext-all-debug.js里面报一堆错误
比如:onBeforeAdd : function(item){
if(item.ownerCt){//第14161行,ownerCt为空或不是对象
item.ownerCt.remove(item, false);
}
if(this.hideBorders === true){
item.border = (item.border === true);
}
}
lookupComponent : function(comp){
if(typeof comp == 'string'){
return Ext.ComponentMgr.get(comp);
}else if(!comp.events){//第14183行,events为空或不是对象
return this.createComponent(comp);
}
return comp;
}
getComponentId : function(comp){
return comp.itemId || comp.id;//第14087行,itemId为空或不是对象
}
add : function(comp){
if(!this.items){
this.initItems();
}
var a = arguments, len = a.length;
if(len > 1){
for(var i = 0; i < len; i++) {
this.add(a[i]);
}
return;
}
var c = this.lookupComponent(this.applyDefaults(comp));
var pos = this.items.length;
if(this.fireEvent('beforeadd', this, c, pos) !== false && this.onBeforeAdd(c) !== false){
this.items.add(c);
c.ownerCt = this;//第14111行,ownerCt为空或不是对象
this.fireEvent('add', this, c, pos);
}
return c;
}
doLayout : function(shallow){
if(this.rendered && this.layout){
this.layout.layout();
}
if(shallow !== false && this.items){
var cs = this.items.items;
for(var i = 0, len = cs.length; i < len; i++) {
var c = cs[i];
if(c.doLayout){//第14120行,doLayout为空或不是对象
c.doLayout();
}
}
}
}
特别是 div 这些元素,因为 ext 最喜欢绑定到 div 上面。
因为 FF 的 document.getElementById(''); 可就一定需要元素有 id 而不是 name !
文件加载路径设置错误的话,是会有一大堆对象找不到的错的。^_^