Ext JS:将 GeoExt 迁移到 v4...“尝试从页面上尚未加载的类进行扩展”
我正在尝试将 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||{});
}
I'm trying to migrate an Ext 3.3.1 application to Ext 4 (with the compatabiltiy layer, for now). I've run into some problems with GeoExt. Currently, it's breaking on line 99, saying "Attempting to extend from a class which has not been loaded on the page." Line 99 is all of the code below.
Any sugegstions or hints for how to approach this problem would be greatly appreciated. Thanks.
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||{});
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了这个。它能解决您的问题吗?
http://www.sencha.com/forum/archive/index.php/t-125402.html?s=cdae2bc4c55d9b9436b67d7a799addee
I found this. Does it fix your problem?
http://www.sencha.com/forum/archive/index.php/t-125402.html?s=cdae2bc4c55d9b9436b67d7a799addee