I have a grid that I load from the database:
oGrd.load("Objects_BRKR.ashx?action=Get");
If there is some sort of database error, I have some error handling that sends the back the relevant info in the XML.
<?xml version="1.0" encoding="utf-8"?>
<rows>
<result status="error" />
<error errorNo="8134" errorDescription="Oops! Blah, blah, blah" />
</rows>
The load may appear to be successful, just with zero rows being rendered.
However, I want to be able to look at the returned XML to determine if the status was “error” and then display an appropriate message to the user.
I was hoping the doAfterRefresh variant of load might help:
myGrid.load("grid.xml",doAfterRefresh);
But doAfterRefresh doesn’t appear to provide access to the XML response such as when you use window.dhx4.ajax.get:
window.dhx4.ajax.get("Objects_BRKR.ashx?action=Get", function(r){
var x = r.xmlDoc.responseXML;
var result = x.getElementsByTagName("result")[0].attributes;
var status = result.getNamedItem("status").nodeValue;
if (status=="error"){
//display error dialog
]
});
So, is there a way for me to access the XML after the load is finished to achieve my error handling requirement?