在使用ExtJS 3.0的时候,出现这个问题。树节点可以绘制出来,但是却不能点击。打开控制台后发现报错:无法获取未定义或 null 引用的属性“ui”。如果开启兼容模式在没有问题,在Google浏览器下没有问题。
在网上搜索的时候发现有人说在ExtJS 2.2中同样出错,估计是老版本的ExtJS不兼容IE9、IE10造成的。网上给出的解决方案是:
找到getAttributeNS方法,然后将它修改为:
getAttributeNS: (Ext.isIE && !(/msie 9/.test(navigator.userAgent.toLowerCase()) && document.documentMode === 9) && !(/msie 10/.test(navigator.userAgent.toLowerCase()) && document.documentMode === 10)) ? function (ns, name) { var d = this.dom; var type = typeof d[ns + ":" + name]; if (type != 'undefined' && type != 'unknown') { return d[ns + ":" + name]; } return d[name]; } : function (ns, name) { var d = this.dom; return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name) || d.getAttribute(name) || d[name]; }
通过对比发现只是修改了第一行中的判断,高亮显示的地方是进行过修改的代码。
转载于:http://www.qeefee.com/article/000166