Dojo 1.8 Tree在IE8 / 9中无法正常工作,鼠标悬停在节点上时触发错误

时间:2013-04-15 18:38:53

标签: internet-explorer dojo tree internet-explorer-9 mouseover

我遇到了Dojo 1.8的IE8问题。现在我的实现(由于工作隐私问题,我无法发布)呈现树,但我无法选择并在未压缩的dojo.js中从第15178行第11行获取函数预期错误。只要我将鼠标悬停在树中的节点上,就会触发。

该行如下:

while(!matchesTarget.matches(eventTarget, selector, target)){
                    if(eventTarget == target || children === false || !(eventTarget = eventTarget.parentNode) || eventTarget.nodeType != 1){ // intentional assignment
                        return;
                    }

这不会发生在Chrome或FF中。

尝试调试我尝试从dojo运行标准参考代码和来自livedocs的代码的示例代码。既不是代码玻璃也不是jsfiddle,但两者都适用于chrome和FF。

我正在使用程序化实现。

是否还有其他人遇到此问题,或者这可能是一个已知问题?

以下是我试图在IE中运行的示例代码:

require([
    "dojo/_base/window", "dojo/store/Memory",
    "dijit/tree/ObjectStoreModel", "dijit/Tree",
    "dojo/domReady!"
], function(win, Memory, ObjectStoreModel, Tree){

    // Create test store, adding the getChildren() method required by ObjectStoreModel
    var myStore = new Memory({
        data: [
            { id: 'world', name:'The earth', type:'planet', population: '6 billion'},
            { id: 'AF', name:'Africa', type:'continent', population:'900 million', area: '30,221,532 sq km',
                    timezone: '-1 UTC to +4 UTC', parent: 'world'},
                { id: 'EG', name:'Egypt', type:'country', parent: 'AF' },
                { id: 'KE', name:'Kenya', type:'country', parent: 'AF' },
                    { id: 'Nairobi', name:'Nairobi', type:'city', parent: 'KE' },
                    { id: 'Mombasa', name:'Mombasa', type:'city', parent: 'KE' },
                { id: 'SD', name:'Sudan', type:'country', parent: 'AF' },
                    { id: 'Khartoum', name:'Khartoum', type:'city', parent: 'SD' },
            { id: 'AS', name:'Asia', type:'continent', parent: 'world' },
                { id: 'CN', name:'China', type:'country', parent: 'AS' },
                { id: 'IN', name:'India', type:'country', parent: 'AS' },
                { id: 'RU', name:'Russia', type:'country', parent: 'AS' },
                { id: 'MN', name:'Mongolia', type:'country', parent: 'AS' },
            { id: 'OC', name:'Oceania', type:'continent', population:'21 million', parent: 'world'},
            { id: 'EU', name:'Europe', type:'continent', parent: 'world' },
                { id: 'DE', name:'Germany', type:'country', parent: 'EU' },
                { id: 'FR', name:'France', type:'country', parent: 'EU' },
                { id: 'ES', name:'Spain', type:'country', parent: 'EU' },
                { id: 'IT', name:'Italy', type:'country', parent: 'EU' },
            { id: 'NA', name:'North America', type:'continent', parent: 'world' },
            { id: 'SA', name:'South America', type:'continent', parent: 'world' }
        ],
        getChildren: function(object){
            return this.query({parent: object.id});
        }
    });

    // Create the model
    var myModel = new ObjectStoreModel({
        store: myStore,
        query: {id: 'world'}
    });

    // Create the Tree.
    var tree = new Tree({
        model: myModel
    });
    tree.placeAt(win.body());
    tree.startup();
});

1 个答案:

答案 0 :(得分:1)

解决:问题是我们的一个JS文件中的一个方法是由于一些时髦的IE mojo而踩着Dojo.js中的匹配函数。