Hello, is there any possibility to load data into grid from a XML string instead a URL?
My XML is custom so I need to use:
mygrid._process_custom_xml = function (xml)
{ …
var rows = xml.doXPath("//clipfull");
…
}
That works ok if I use mygrid.load(URL, “custom_xml”) but if I use mygrid.parse(xml_string, “custom_xml”) the the xml.doXpath does not work, and I need to load the XML from a string not from a URL.
You should add extra code to the row level parser:
grid._process_custom_xml=function(xml){
this._parsing=true;
if (!xml.doXPath){
var t = new dtmlXMLLoaderObject(function(){});
if (typeof xml == "string")
t.loadXMLString(xml);
else {
if (xml.responseXML)
t.xmlDoc=xml;
else
t.xmlDoc={};
t.xmlDoc.responseXML=xml;
}
xml=t;
}
... //rest of the code
After a few tests I noticed that the code works good for Internet Explorer, but xml.doXPath("//…") returns 0 rows for Firefox and Chrome. The dtmlXMLLoaderObject is correctly created in all browsers.