Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by tep on Mar 31, 2008 20:59
open dhtmlx forum
how to know if an loadXML has happened?

im planning of catching the loadXML error..
is there a way to know if the error has occured?like events or anything..thanks..
Answer posted by Support on Apr 01, 2008 10:13
You can catch error and prevent error message by using default error handling routine.

function myErrorHandler(type, desc, erData){
    //custom code can be placed here
    return false;
}
dhtmlxError.catchError("LoadXML", myErrorHandler);

The array contains additonal data related to error
    erData=[xmlHttpRequest , object]

First element - xmlHttpRequest object, which contain all data requested from server.
Second element - dhtmlx object, component which throw error while loading.

You can get any additional error info by checking xmlHttpRequest properties (xmlHttpRequest.responseText for example )
Answer posted by Support on Apr 01, 2008 10:14
The moment when loadXML finished loading can be catched by using onXLE event of component.
Answer posted by tep on Apr 03, 2008 22:44

Hi,

i used

function myErrorHandler(type, desc, erData){
    //custom code can be placed here
    return false;
}
dhtmlxError.catchError("LoadXML", myErrorHandler);


to handle error durig loadxml, i just cant seem to return the frid object..

i have 2 grids on my page grid1 and grid 2..what im trying to do is when the error occurs i try to reload the grid which caused the error..
i do this by using erData, as youve said the second element is the object.. so inside myErrorHandler i have a statement like erData[1].loadXML("xml.xml") (2nd element), something like that but the loadXML does not reload again..when i try to alert(erData[1]) it returns [object]..

hope you can shed light on this..
tnx..

Answer posted by Support on Apr 04, 2008 01:48