本文介绍了Ext JS的4:JavaScript异常"类型错误:Ext.resetElement是未定义的"在Ext JS的版本4.1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的Ext JS 4.1.1打破了我的代理我已经设置了ASP.NET。我不得不切换回4.1.0版本来解决该问题。只是想我抛出这个问题在那里,直到它是由煎茶解决。

JavaScript异常:

类型错误:Ext.resetElement未定义==>...... s.styleProxyEl ||(Ext.AbstractComponent.prototype.styleProxyEl==> EXT-ALL-debug.js(线路26960)

  getStyleProxy:功能(CLS){    VAR的结果= this.styleProxyEl || (Ext.AbstractComponent.prototype.styleProxyEl = Ext.resetElement.createChild({
        风格:{
            位置:绝对,
            顶部:-10000px
        }
    },NULL,TRUE));    result.className = CLS;
    返回结果;
},

解决方法:

ExtJS的框架,而不是使用版本4.1.1的下载版本4.1.0。

如果有人能在这里说明一下到底是什么打破了,我会标记他们的答案是正确的。下面是我使用代理服务器。

  Ext.define('Ext.ux.AspWebAjaxProxy',{
    延伸:Ext.data.proxy.Ajax',
    要求:'Ext.data',    buildRequest:功能(操作){
        VAR PARAMS = Ext.applyIf(operation.params || {},this.extraParams || {})
                                请求;
        PARAMS = Ext.applyIf(参数,可以this.getParams(参数,可以操作));
        如果(operation.id&安培;&安培;!params.id){
            params.id = operation.id;
        }        PARAMS = Ext.JSON.en code(PARAMS);        请求= Ext.create('Ext.data.Request',{
            params:一个参数,可以
            动作:operation.action,
            记录:operation.records,
            操作:操作,
            网址:operation.url
        });
        request.url = this.buildUrl(请求);
        operation.request =请求;
        返回请求;
    }
});


解决方案

请确保您使用的是 Ext.onReady(函数(){...})。 ExtJS的使用 Ext.resetElement 这是之前设置 onReady 电话。

Ext JS 4.1.1 broke my proxies I had set up with ASP.NET. I had to switch back to version 4.1.0 to resolve the issue. Just thought I'd throw this issue out there until it's resolved by Sencha.

JavaScript Exception:

"TypeError: Ext.resetElement is undefined" ==> "...s.styleProxyEl || (Ext.AbstractComponent.prototype.styleProxyEl" ==> ext-all-debug.js (line 26960)

getStyleProxy: function(cls) {

    var result = this.styleProxyEl || (Ext.AbstractComponent.prototype.styleProxyEl = Ext.resetElement.createChild({
        style: {
            position: 'absolute',
            top: '-10000px'
        }
    }, null, true));

    result.className = cls;
    return result;
},

Workaround:

Download version 4.1.0 of the ExtJS framework instead of using version 4.1.1.

http://cdn.sencha.io/ext-4.1.0-gpl.zip

If someone can explain what broke here exactly, I'll mark their answer as correct. Here is the proxy I'm using.

Ext.define('Ext.ux.AspWebAjaxProxy', {
    extend: 'Ext.data.proxy.Ajax',
    require: 'Ext.data',

    buildRequest: function (operation) {
        var params = Ext.applyIf(operation.params || {}, this.extraParams || {}),
                                request;
        params = Ext.applyIf(params, this.getParams(params, operation));
        if (operation.id && !params.id) {
            params.id = operation.id;
        }

        params = Ext.JSON.encode(params);

        request = Ext.create('Ext.data.Request', {
            params: params,
            action: operation.action,
            records: operation.records,
            operation: operation,
            url: operation.url
        });
        request.url = this.buildUrl(request);
        operation.request = request;
        return request;
    }
});
解决方案

Make sure you are using Ext.onReady(function() { ... }). ExtJS uses Ext.resetElement which is set before onReady call.

这篇关于Ext JS的4:JavaScript异常"类型错误:Ext.resetElement是未定义的"在Ext JS的版本4.1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 02:38