3
votes

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)

enter image description here

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;
    }
});
2
what do you exactly mean with broke my proxies I had set up with ASP.NETsra
@sra - pasted my proxy class in the questionMacGyver
As far as I can tell the error is thrown while something is rendered by the Ext.util.Renderable mixin and I see nothing of that within your proxy. Have you had a look at the callstack?sra
I'm a newbie with JavaScript programming, but this ExtJS framework is beginning to grow on me. Can you tell me where to find that?MacGyver
You seem to use use firefox along with firebug. I am not quite shure if you can find a stacktrace there... I recommend you to use chrome with active developer tools. These will give you a stacktracesra

2 Answers

3
votes

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

2
votes

Another workaround that works for me is to define this element before using ext objects:

Ext.resetElement = Ext.getBody();