Ext JS 4:JavaScript异常“TypeError:Ext.resetElement未定义”在Ext JS 4.1.1版中 [英] Ext JS 4: JavaScript Exception "TypeError: Ext.resetElement is undefined" in Ext JS version 4.1.1
问题描述
JavaScript异常:
TypeError:Ext.resetElement is undefined= =>... s.styleProxyEl ||(Ext.AbstractComponent.prototype.styleProxyEl==> ext-all-debug.js(第26960行)
< img src =https://i.stack.imgur.com/G5ukg.jpgalt =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;
返回结果;
},
解决方法:
下载ExtJS框架的4.1.0版本,而不是使用4.1.1版。
http://cdn.sencha.io /ext-4.1.0-gpl.zip
如果有人可以解释这里发生了什么,我会把他们的答案标记为正确。这是我正在使用的代理。
Ext.define('Ext.ux.AspWebAjaxProxy',{
扩展:'Ext.data.proxy.Ajax',
require:'Ext.data',
buildRequest:function(operation){
var params = Ext.applyIf operation.params || {},this.extraParams || {}),
请求;
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;
返回请求;
}
});
确保您使用 Ext.onReady(function(){...})
。 ExtJS使用 onReady
呼叫之前设置的 Ext.resetElement
。
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异常“TypeError:Ext.resetElement未定义”在Ext JS 4.1.1版中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!