Jonathan Millar
Jonathan Millar

Reputation: 21

Dojo 1.8 Tree not working correctly in IE8/9, Error fired when mouse over node

I am having IE8 issues with Dojo 1.8. Now my implementation (which I am unable to post due to work privacy concerns) renders the tree but I am unable to select and am getting a Function Expected error from line 15178 char 11 in dojo.js uncompressed. This fires whenever I mouseover a node in the tree.

the line is as follows:

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

This does not happen in Chrome or FF.

To try and debug i tried running the example code from dojo both the standard reference code and the code from livedocs. Neither work in Ie both in code glass nor jsfiddle, but both work in chrome and FF.

I am using a programmatic implementation.

Has anyone else encountered this or is it perhaps a known issue?

Here is the example code i tried to run in 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();
});

Upvotes: 1

Views: 630

Answers (1)

Jonathan Millar
Jonathan Millar

Reputation: 21

Solved: Issue was a method in one of our JS files was stepping on the match function in Dojo.js due to some funky IE mojo.

Upvotes: 1

Related Questions