Hello,
I’m trying to learn how to use dhtmlxDataStore.
The idea is to load several dataStores on my page on which grids, forms, views and charts… can get their datas and also, to get some values and set new variables into my JS script.
Here is my code :
var myData= new dhtmlXDataStore({
url:"data/data.xml",
datatype: "xml"
});
data.xml contains :
<data>
<item id="1">
<Name><![CDATA[Dammann]]></Name>
<Department><![CDATA[Legal Department]]></Department>
<Gender><![CDATA[Male]]></Gender>
</item>
<item id="2">
<Name><![CDATA[Barby]]></Name>
<Department><![CDATA[Human Resources]]></Department>
<Gender><![CDATA[Female]]></Gender>
</item>
</data>
How can I get the content of “Name” where ID = 2 ?
Reading the API documentation, it looks like I can use the item(id) method.
But using myData.items(2) throws “undefined” using alert().