views:

14

answers:

1

I'm a beginner here so I apologize if this question is badly worded.

I have an XmlTreeLoader that is loaded up every time a row is clicked in an Ext.grid. It works fine in Firefox and Chrome, but whenever I try to run it in IE I get the error:

Wrong number of arguments or invalid property assignment

I tried using the developer toolbar in IE8 to figure out what's going on, and what I found was that when the function parseXml is called on the root, the root node's "item" property has the error: Wrong number of arguments or invalid property assignment, which is the error displayed above.

My hypothesis is that the XML I'm receiving is badly formed... I feel like that's something IE is strict about no?

Here's my code in case the hypothesis is incorrect. Row Selection:

    selModel: new Ext.grid.RowSelectionModel({
        singleSelect: true,
        listeners: {
            rowselect: function(sm, rowIndex, record) {
                var root = Ext.getCmp('searchDetailPanel').root;
                root.loader = new rmg.sscp.search.xmlLoader({
                    dataUrl: 'detail',
                    baseParams: {
                        uid: record.id
                    }
                })
                root.reload();
            }
        }
    })

xmlLoader:

rmg.sscp.search.xmlLoader = Ext.extend(Ext.ux.tree.XmlTreeLoader, {
    processAttributes : function(attr){
        var text = attr.tagName;
        attr.text = text + ' ' + attr.textContent;
        attr.loaded = true;
        attr.expanded = true;
    }
});
A: 

I solved it, there were 2 problems:

1) The XML didn't have a MIME type. I added "text/xml" as the content type when generating the response from the server, and the XML began being read properly. IE is very picky about this kind of stuff.

2) IE doesn't like Ext.each on a list with nothing in it. To fix this, I put in a simple if statement to check if the list was empty.

The IE8 debugger was of great use here. See this post: http://stackoverflow.com/questions/1956384/how-do-i-dump-javascript-vars-in-ie8

stinkycheeseman