Javascript Ext JS:正在将GeoExt迁移到v4&引用;试图从页面上未加载的类扩展;
我正在尝试将Ext3.3.1应用程序迁移到Ext4(目前使用兼容层)。我在GeoExt上遇到了一些问题。目前,它在第99行被打断,说“试图从尚未加载到页面上的类扩展。”第99行是下面的所有代码。 任何关于如何解决这个问题的建议或提示都将不胜感激。谢谢Javascript Ext JS:正在将GeoExt迁移到v4&引用;试图从页面上未加载的类扩展;,javascript,extjs,extjs4,geo,extjs3,Javascript,Extjs,Extjs4,Geo,Extjs3,我正在尝试将Ext3.3.1应用程序迁移到Ext4(目前使用兼容层)。我在GeoExt上遇到了一些问题。目前,它在第99行被打断,说“试图从尚未加载到页面上的类扩展。”第99行是下面的所有代码。 任何关于如何解决这个问题的建议或提示都将不胜感激。谢谢 return selectControl; },featureSelected:function(evt){ if(!this._selecting){ var store=this.grid.store;
return selectControl;
},featureSelected:function(evt){
if(!this._selecting){
var store=this.grid.store;
var row=store.findBy(function(record,id){
return record.data.feature==evt.feature;
});
if(row!=-1&&!this.isSelected(row)){
this._selecting=true;
this.selectRow(row,!this.singleSelect);
this._selecting=false;
this.grid.getView().focusRow(row);
}
}
},
featureUnselected:function(evt){
if(!this._selecting){
var store=this.grid.store;
var row=store.findBy(function(record,id){
return record.data.feature==evt.feature;
});
if(row!=-1&&this.isSelected(row)){
this._selecting=true;
this.deselectRow(row);
this._selecting=false;
this.grid.getView().focusRow(row);
}
}
},
rowSelected:function(model,row,record){
var feature=record.data.feature;
if(!this._selecting&&feature){
var layers=this.getLayers();
for(var i=0,len=layers.length;i<len;i++){
if(layers[i].selectedFeatures.indexOf(feature)==-1){
this._selecting=true;
this.selectControl.select(feature);
this._selecting=false;
break;
}
}
}
},
rowDeselected:function(model,row,record){
var feature=record.data.feature;
if(!this._selecting&&feature){
var layers=this.getLayers();
for(var i=0,len=layers.length;i<len;i++){
if(layers[i].selectedFeatures.indexOf(feature)!=-1){
this._selecting=true;
this.selectControl.unselect(feature);
this._selecting=false;
break;
}
}
}
},
getLayers:function(){
return this.selectControl.layers||[this.selectControl.layer];
}
};
GeoExt.grid.FeatureSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,GeoExt.grid.FeatureSelectionModelMixin);
Ext.namespace("GeoExt","GeoExt.data");
GeoExt.data.LayerReader=function(meta,recordType){
meta=meta||{};
if(!(recordType instanceof Function)){
recordType=GeoExt.data.LayerRecord.create(recordType||meta.fields||{});
}
返回selectControl;
},功能选定:功能(evt){
如果(!this.\u正在选择){
var store=this.grid.store;
var row=store.findBy(函数(记录,id){
返回record.data.feature==evt.feature;
});
如果(行!=-1&&!this.isSelected(行)){
这是.\u选择=true;
this.selectRow(row,!this.singleSelect);
这是错误的;
this.grid.getView().focusRow(row);
}
}
},
功能未选择:功能(evt){
如果(!this.\u正在选择){
var store=this.grid.store;
var row=store.findBy(函数(记录,id){
返回record.data.feature==evt.feature;
});
如果(行!=-1&&this.isSelected(行)){
这是.\u选择=true;
这一行(行),;
这是错误的;
this.grid.getView().focusRow(row);
}
}
},
rowSelected:功能(模型、行、记录){
var feature=record.data.feature;
如果(!this.\u选择&&feature){
var layers=this.getLayers();
对于(var i=0,len=layers.length;i我找到了这个。它解决了您的问题吗
Ext.ux.form.AGrid=Ext.extend(Ext.grid.EditorGridPanel{
布拉布拉:“测试”
})
尝试使用新的Ext.define。如果您使用的是动态加载,则需要将define与extend一起使用:“someclass”。这样,动态加载程序将确保首先加载您要扩展的类
或者,您可以只使用ext-all.js,并以旧的方式进行操作
谢谢;这很有帮助,但不幸的是并不能解决问题。有了兼容层,我无法使用requires,没有兼容层,我会得到初始错误。