Dhtmlxgrid parse(xml) method not working in IE10

We are using dhtmlxgrid v3.6 to display the tree structure in a pop up. The tree structure gets displayed fine in IE 8, IE9 but not in IE10.

We are getting the script error:
SCRIPT438: Object doesn’t support property or method ‘selectNodes’
dhtmlxcommon.js, line 35 character 137

Please let us know if this is known issue in IE10.

Unfortunately the issue cannot be reproduced locally.
Please, provide with any kind of sample of your code with the init of your treegrid.

We are experiencing the same issue when we use grid.parse (xml).

Unhandled exception at line 35, column 137 in …/dhx/3.6/dhtmlxcommon.js
0x800a01b6 - JavaScript runtime error: Object doesn’t support property or method ‘selectNodes’

This doesn’t happen on IE9, Chrome, nor Firefox. Only in IE10. I haven’t tried it in IE11 yet.

Example code that would break on IE10 but not on other browsers.

var someLayout = new dhtmlXLayoutObject(“ignoredDomainsGridDiv”, “1C”, “dhx_skyblue”);
var someGrid = someLayout.cells(“a”).attachGrid();
someGrid.setHeader(",Domain");
someGrid.setNoHeader(true);
someGrid.setColumnIds(“someId,Domain”);
someGrid.setInitWidths(“0,*”);
someGrid.setColAlign(“left,left”);
someGrid.setColTypes(“ro,ed”);
someGrid.setSkin(“dhx_skyblue”);
someGrid.enableAlterCss(“even_row”, “odd_row”);
someGrid.enableEditEvents(false, true, false);
someGrid.init();

someGrid.clearAll();
someGrid.parse(’’);

The issue still cannot be reproduced locally.



Please, make sure that the you have the latest version of dhtmlxgrid. If issue still occurs for you, please, provide with a demo link or a complete demo, where the issue can be reconstructed.

Hello,

I have a smiliar issue with IE11 and the treegrid, that is:

SCRIPT438: Object doesn't support property or method 'selectNodes' dhtmlxcommon.js, Line: 690, Column: 4

I have used the latest dhtmlxgrid.js, dhtmlxtreegrid.js and dhtmlxcommon.js from the dhtmlxTreeGrid_v36_pro_131108 package and also tried the dhtmlxcommon.js from the dhtmlx_hf_ie11_131023 package, however neither resolves the problem.

It seems with IE10+ you need to use msxml-document as responseType however I have no idea where to patch this in the code. Any thoughts ?

There are some differences in how native xmlHttpRequest works, but dhtmlx lib uses xmlhttp activeX control, that works the same for all versions of IE. So while you are loading data by http - it will work correctly. If you are loading data from local filesystem or loading it with incorrect content-type ( it must be set to “text/xml” ) then issue can occur.

Hello Stanislav

Thanks for your response.

I checked my server side code and I am sending

header("Content-type: text/xml");

before returning the content to DHTMLX TreeGrid.

Just to confirm I am using

treegrid_obj.loadXML('path/to/xml_feed');

To populate the treegrid.

Any other thoughts ? I could migrate to DHTMLX4 but it is a lot of work unless this is a drop-in replacement for v3.6 ?

Thanks
Tim

I forgot to say I am loading XML from server via HTTP and not via file system, e.g.

treegrid.loadXML('http://10.0.0.34/xml/feed');

a) Press F12 and check the rendering and compatibility mode settings.
b) Check the security settings, if you have set High security profile IE can block the xmlhttp usage

I don’t sure that update to 4.0 will help, as there was no significant updates for data loading code.

Also, if you are using IE11 - you need the latest 3.6 build, older one can work incorrectly with latest version of IE

Hello,

I have the same error with IE11 and IE9.

If I set either IE11 or IE9 to IE8 Document mode then it works, but I do not think this is a viable solution ? There must be another way ?

I will double check again I am using the 3.6 files.

Thanks,
Tim

Hi Stanislav

Just to make sure I don’t suppose you can send me a link to the latest 3.6 including all fixes for IE11 ?

Thanks
Tim

This is what I have:

dhtmlxcommon.js - version v.3.6 build 131108
dhtmlxgrid.js - v.3.6 build 131108
dhtmlxtreegrid.js - v.3.6 build 131108

I have purchased a PRO license of dhtmlxtreegrid (10/09/2013), if it makes a difference.

I have tried turning off IE11 protected mode and lowering security - it still results in the same error. I actually don’t need it to work with IE9/10, just with IE11.

For completeness, I also include in my project:

dhtmlxgridcell.js
dhtmlxgrid_excell_ra_str.js
dhtmlxgrid_export.js

I also tried dhtmlxcommon_debug.js from the dhtmlxTreeGrid_v36_pro_131108/dhtmlxGrid/codebase archive however that resulted in a different error in IE11:

SCRIPT438: Object doesn't support property or method 'getElementsByTagName'
File: dhtmlxcommon_debug.js, Line: 776, Column: 3

Looking forward to your reply,

Thanks,
Tim

Hello Stanislav

I found something.

The grids I use which load via loadXML work OK in IE11.

The grid I was having problems with used treegrid.parse(xmldata) where xmldata is a string returned from the server (content-type text/xml). This throws the error.

If I replace .parse with .loadXML I no longer get the selectnodes error, but instead another error within dhtmlxcommon.js:

Object doesn't support property or method 'indexOf'
File: dhtmlxcommon.js, Line: 13, Column: 70

I am going to track down the cause of that next. I am not sure yet if changing from .parse to .loadxml will have any big impact on my system.

Thanks
Tim

Hi,

In case it helps anyone else I fixed the problem.

The reason I was using .parse to populate the grid was because I had to do a POST to the server to retrieve the data, passing a set of parameters, and then I was using grid.parse(xmldata); to populate the grid. This caused the selectnodes issues as described. I used .parse because loadXML sends a GET request, however I found the dhtmlxgrid_post.js extension which solved the problem. I now used something like this to load the grid instead of .parse or loadXML:

grid_obj.post(base_url + "xmlfeed", "param1=postdata&param2=moredata", function() {
alert("Loaded OK");
}, "xml");

Thanks for your help
Tim

We have got an old license of dhtmlxgrid. Can we use dhtmlx_hf_ie11_131023 hotfix?

Please reply soon.


Thanks

anas.razvi, what dhtmlxgrid version do you have?
Most probably you may apply the hot fix and will work correctly.