开发者

Ext JS: migrating GeoExt to v4... "Attempting to extend from a class which has not been loaded on the page"

开发者 https://www.devze.com 2023-03-26 19:38 出处:网络
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

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;
     开发者_如何学Python          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 found this. Does it fix your problem?

Ext.ux.form.AGrid = Ext.extend(Ext.grid.EditorGridPanel, { blabla: 'test' }) Try using the new Ext.define. If you are using the dynamic loading, you need to use define with extend: 'someclass'. That way the dynamic loader will make sure to load the class you are extending first.

Alternately you could just use ext-all.js and do it the old way.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号