Extjs: 对象不支持“createContextualFragment”属性或方法

环境:extjs 2.3.0,ie 9 32位(Firefox(23)正常)

触发事件:

EditorGridPanel中,点击日期选择控件的时候。

错误信息:

中文:

SCRIPT438: 对象不支持“createContextualFragment”属性或方法
ext-all.js, 行35 字符108

英文

Object doesn't support property or method 'createContextualFragment'

解决方法:

第一步:

插入以下代码

 1 if (typeof Range.prototype.createContextualFragment == "undefined") {
 2     Range.prototype.createContextualFragment = function(html) {
 3         var startNode = this.startContainer;
 4         var doc = startNode.nodeType == 9 ? startNode : startNode.ownerDocument;
 5         var container = doc.createElement("div");
 6         container.innerHTML = html;
 7         var frag = doc.createDocumentFragment(), n;
 8         while ( (n = container.firstChild) ) {
 9             frag.appendChild(n);
10         }
11         return frag;
12     };
13 }
View Code

第二步:

javascript报错的问题解决了,但是,日期控件不全。

解决方法有两种:

1. 增加CSS:

.x-date-menu { 175px !important; }

2. 增加meta(测试未通过)

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 

参考:

1. 对象不支持“createContextualFragment”属性或方法

2. ext datefield 在ie8 ie9下显示不完全

3. DateField and IE9

原文地址:https://www.cnblogs.com/m1234/p/3325705.html