0

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

1 回答 1

1

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

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

或者,您可以只使用 ext-all.js 并以旧方式进行。

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

于 2011-08-09T16:15:58.687 回答