Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Definelife on Nov 27, 2009 07:58
open dhtmlx forum
How to load XML string in dhtmlxGrid

Dear Support,

I am trying to load XML string in the dhtmlxGrid like:
grid.parse(xmlString);

header information has been setted correctly but record information doesn't.
My xml String looks like:

<head>
<column width="100" type="ro" align="right" color="#d5f1ff" sort="na">Customer number</column>
<column width="100" type="ro" align="right" color="#d5f1ff" sort="na">BirthDate</column>
<column width="100" type="ro" align="right" color="#d5f1ff" sort="na">Benefit date</column>
<column width="100" type="ro" align="left" color="#d5f1ff" sort="na">Covered on</column>
<column width="100" type="ro" align="left" color="#d5f1ff" sort="na">Relation</column>
<column width="100" type="ro" align="left" color="#d5f1ff" sort="na">Relative name</column>
</head>
<row id="1">
<cell> 1</cell>
<cell>15/01/98</cell>
<cell>15/01/98</cell>
<cell>yes</cell>
<cell>Daughter</cell>
<cell>Jenny Koberlein</cell>
</row>
<row id="2">
<cell> 1</cell>
<cell>07/12/65</cell>
<cell>16/03/98</cell>
<cell>yes</cell>
<cell>Spouse</cell>
<cell>Ken Koberlein</cell>
</row>
<row id="3">
<cell> 2</cell>
<cell>21/12/90</cell>
<cell>03/11/97</cell>
<cell>yes</cell>
<cell>Son</cell>
<cell>Bill Andrews</cell>
</row>
</rows>

If I load that XML from the file it works perfectly. Could je please tell me how can i load XML string in the grid object?
Answer posted by Alex (support) on Nov 27, 2009 08:51

Hello

please check the sample in the grid package dhtmlxGrid/samples/12_initialization_loading/10_init_grid_xml.html (the same sample on our website http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/12_initialization_loading/10_init_grid_xml.html )