I am trying to load the dhtmlxgrid with XML data that I am getting from a SQL Server database. I can load the grid if I build an XML document manually, like:
test1
test2
But the XML that SQL Server generates with its FOR XML PATH process doesn’t name the cells “”, but instead they have the names of the columns, so my data looks like this:
John Smith
39
San Francisco
And apparently the dhtmlxgrid doesn’t like this, because none of that data gets displayed. So is there a way to make the grid accept the XML where all the cells aren’t name “”, or does anybody know how to get SQL Server to name all its XML cells to “”?
Thanks for your reply, Olga, but that doesn’t seem to do it for me. I don’t have a url, I’m trying to load the XML from a string that is returned by a web service that calls a stored proc on SQL Server. I am using the grid.parse method to load the data, but it doesn’t appear to allow the “xmlB” parameter.
Any other ideas?
My code looks like this:
function CreateGrid(xmldata) {
gbgrid = new dhtmlXGridObject('gbgridbox');
gbgrid.init();
gbgrid.parse(xmldata);
};
And it works fine if I create a test xml string with and elements, but not if I use the data as it comes from MSSQL.