Ext JS:将GeoExt迁移到v4 ......“尝试从尚未加载到页面上的类扩展”

时间:2011-08-09 15:11:34

标签: javascript extjs extjs4 geo extjs3

我正在尝试将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||{});
    }

1 个答案:

答案 0 :(得分:1)

我找到了这个。它能解决你的问题吗?

  

Ext.ux.form.AGrid = Ext.extend(Ext.grid.EditorGridPanel,{   blabla:'测试'   })   尝试使用新的Ext.define。如果使用动态加载,则需要使用define with extend:'someclass'。这样,动态加载器将确保加载您首先扩展的类。

     

或者你可以使用ext-all.js并以旧的方式进行。

http://www.sencha.com/forum/archive/index.php/t-125402.html?s=cdae2bc4c55d9b9436b67d7a799addee