cannot bind form to datastore

Hello,
Could you please help me ?

Here’s the code which init and load my DataStore :

var dataStore = new dhtmlXDataStore({ url:"getdatastore.php?action=getinfo&id="+id, datatype: "xml" });

Here’s an example of the returned xml :

<data> <item id="999"> <firstname>DHTMLX</firstname> <lastname>FORM</lastname> <Version>3.0 PRO</Version> </item> </data>

Here my Form Definition :

[code]formData = [
{ type:“settings” , labelWidth:160, labelAlign:“left”, position:“absolute” },
{ type:“input” , id:“firstname”, name:“firstname”, label:“First Name”, labelAlign:“left”, inputWidth:85, labelLeft:5, labelTop:5, inputLeft:110, inputTop:5 },
{ type:“input” , id:“lastname”, name:“lastname”, label:“Last Name :”, labelAlign:“left”, inputWidth:85, labelLeft:5, labelTop:30, inputLeft:110, inputTop:30 },
{ type: “input”, id:“Version”, name: “Version”, inputLeft:200, inputTop:30}
]

myForm = myCellH.attachForm(formData);
myForm.bind(dataStore);[/code]

My form inputs stay definitely empty :frowning:

What is wrong ?

Thanks :frowning:

Hello,

you need to to set cursor for a certain record in datastore to load it into bound components:

var dataStore = new dhtmlXDataStore({ url:"getdatastore.php?action=getinfo&id="+id, datatype: "xml" }); dataStore.attachEvent("onXLE",function(){ dataStore.setCursor(id); });

Thank you Alexandra !