dhtmlxgrid error handling

After perusing through the forum I was able to view an information regarding error handling for Invalid XML request errors.



The info. I found directs me to use the following code:



function myErrorHandler(type,name,p){

… …

}



dhtmlxError.catchError(“LoadXML”,myErrorHandler);



The above worked fine - at first but here’s the problem. When I generate a server defined error FF browser can handle the errors smoothly thus I was able to parse the xmlhttp response from my error handler but when I run my application using IE6, the error handler is not being invoked and a runtime script exception is thrown at the following function at dhtmlXGrid.js.



dhtmlXGridObject.prototype.parseXML = function(xml,startIndex){







var pid=(top[0].getAttribute(“parent”)||0); /* Error points to this line which is being detected as null*/



}





It is obvious that the line would be null since I have thrown a user defined xml response to initiate the client side error handler. What confuses me is why Firefox was able to handle the error and IE cannot.

Did your server side response is correct XML ?
The loadXML error must fire only if incoming XML can’t be correctly parsed. If it is correct there will not be error message in IE
( FF has slightly different way to work with XML, so in FF error will fire even if response is valid XML, but there is no “rows” tag in XML )

To prevent mentioned error in FF please made next modification in dhtmlxGrid.js ( it will be included in next build )

Please locate next string
    var top=this.xmlLoader.doXPath("//rows",xmlDoc);
and add after it
    if (!top) return;