我正在尝试将 Ext 3.3.1 应用程序迁移到 Ext 4(现在使用兼容层)。我遇到了 GeoExt 的一些问题。目前,它在第 99 行中断,显示“尝试从页面上尚未加载的类扩展”。第 99 行是下面的所有代码。
任何有关如何解决此问题的建议或提示将不胜感激。谢谢。
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||{});
}