简体   繁体   English

未捕获的错误:元素缓存中ID为x的DOM元素与DOM中的元素不同

[英]Uncaught Error: DOM element with id x in Element cache is not same as element in DOM

I've the following code in UI on the button Click event, which is returning an MS-Excel file. 我在按钮Click事件的UI中包含以下代码,该事件返回一个MS-Excel文件。 It works perfectly in first click event but, return the following error afterwards. 它在第一次单击事件中可完美运行,但是此后返回以下错误。

Any suggestions, how can I get rid of it? 有什么建议,我该如何摆脱呢?

ERROR: Uncaught Error: DOM element with id iframe in Element cache is not the same as element in the DOM. 错误:未捕获错误:元素缓存中ID为iframe的DOM元素与DOM中的元素不同。 Make sure to clean up Element instances using destroy() 确保使用destroy()清理Element实例

{
var body = Ext.getBody();
var frame = body.createChild({
tag:'iframe'
,cls:'x-hidden'
,id:'iframe'
,name:'iframe'
});

var form = body.createChild({
 tag:'form'
,cls:'x-hidden'
,id:'form'
,params: cloneExportObject
 ,method: 'post'
,action:link
,target:'iframe'
,enctype: 'application/x-www-form-urlencoded'
,encoding: 'application/x-www-form-urlencoded'
});

var hiddenItem1 = document.createElement('input');
Ext.fly(hiddenItem1).set({
type: 'hidden',
value: cloneExportObject.securityId,
name: 'securityId'
});
form.appendChild(hiddenItem1);

var hiddenItem2 = document.createElement('input');
Ext.fly(hiddenItem2).set({
type: 'hidden',
value: cloneExportObject.uniqueSearchId,
name: 'uniqueSearchId'
});
form.appendChild(hiddenItem2);

form.dom.submit();
}
if(Ext.Element.cache.hasOwnProperty(domId)){
            Ext.Element.cache[domId].destroy();
        }

        var domElement = Ext.get(domId);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM