Javascript IE7 Ext JS问题:window.close()上出现未指定的JS错误

Javascript IE7 Ext JS问题:window.close()上出现未指定的JS错误,javascript,internet-explorer-7,extjs,Javascript,Internet Explorer 7,Extjs,我正在使用Ext JS创建一个弹出窗口,下面是代码: function popupImage(term, imageNumber){ if(currentPopupWindow!=null){ currentPopupWindow.close(); } currentPopupWindow = new Ext.Window({ layout : 'fit', closeActio

我正在使用Ext JS创建一个弹出窗口,下面是代码:

function popupImage(term, imageNumber){

    if(currentPopupWindow!=null){
        currentPopupWindow.close();
    }

    currentPopupWindow = new Ext.Window({
                layout      : 'fit',
                closeAction :'hide',
                plain       : true,
                constrain   : true,
                width: 300,
                border: false,
                html: "Blah blah content"<span onclick=\"currentPopupWindow.close();\">cerrar</span>"
            });



    currentPopupWindow.show(false, function(){
        var el = Ext.get("termimage");
        currentPopupWindow.setWidth(el.getWidth(true)+150);
    });

    currentPopupWindow.anchorTo(Ext.get("dictionarycontainer"), "tl");
}
函数popupImage(术语,图像编号){
如果(currentPopupWindow!=null){
currentPopupWindow.close();
}
currentPopupWindow=新的外部窗口({
布局:“适合”,
closeAction:“隐藏”,
朴素:没错,
对,,
宽度:300,
边界:错,
html:“诸如此类的内容”cerrar“
});
currentPopupWindow.show(false,函数(){
var el=Ext.get(“termimage”);
currentPopupWindow.setWidth(el.getWidth(true)+150);
});
currentPopupWindow.anchorTo(Ext.get(“dictionarycontainer”),“tl”);
}
在firefox中这很好,在IE7中也可以,但总是产生一个javascript错误,上面写着“未指定的错误”

我做错了什么

编辑
删除anchorTo行将删除错误。我仍然希望锚定到,尽管这不是一个很好的解决方案!

快速的谷歌搜索告诉我,您不是唯一一个遇到这种情况的extJS用户。(有关三个示例,请参阅和。)最好是在他们的网站上发布,这样他们就可以修复他们的bug或解决IE7 bug,无论是哪种情况。

这看起来似乎与此有关,但我并不理解


这就是解决方案,尽管它很愚蠢:

创建相同的窗口,而不是调用show和anchor to:

    currentPopupWindow.render(document.body);
    currentPopupWindow.alignTo(diccon, "tl", [40, 80]);

                currentPopupWindow.show(false, function() {
            var el = Ext.get(termim);
            currentPopupWindow.setWidth(el.getWidth(true)+150);
        });

qui是对的。问题在于anchorTo。使用alignTo,异常就会消失。 对不起,qui,试图“提高”您的回答,但未能做到。我没有任何声誉。:)


a请回答您的第二个问题:删除锚定线会删除错误。我仍然希望锚定到,因此这不是一个很好的解决方案

使用alignTo并监视scroll和mousewheel事件,并相应地更新位置,它与anchorTo相同。这是我找到的解决方法

a文件

尝试添加:

shim:false


弹出窗口参数列表。

它是否给您一个行号?第4行:我在调试器中遇到的未指定错误,它突出显示“M=G.getBoundingClientRect()”作为错误。这将出现在Ext JS中,我没有写。