Stanislav,
Thank you, but that didn’t solve my problem 
Here’s a little more background on what I’m doing:
I have a datastore, to which I’ve bound a grid on a tab that isn’t visible to all users. What is visible is the form, which is bound to the grid.
Initially, the user gets a blank form that they fill in. When they click the submit button, I add the data to the datastore and get the new id. Now, thanks to you, I am able to assign that id to the id field in the form. They have the option to continue to edit their data. When they click Submit the second time, it needs to save the data from the form and have it updated on the server.
I am getting a ‘target’ error and it is failing there, never sending the data the second time.
Here’s the error I’m getting:
[color=red]
target is undefined
target._dhx_proto_wait && (target = target._dhx_proto_wait[0]); on datastore.js (line 18)
What I think is happening is that, while I’m saving the data to the datastore, there’s no clear path of correlation between the new data in the datastore and the form - the grid isn’t getting the info, or it isn’t relating the displayed info to the info in the form.
Here’s my code (abbreviated for relevance)
form_1.attachEvent("onButtonClick", function(name, command){
switch(name){
case "cancel":
tabbar_1.showTab('tab_1');
tabbar_1.setTabActive('tab_1');
tabbar_1.hideTab('tab_2');
// form_1.clear();
break;
case "save":
var keyword = form_1.getItemValue('keyword');
if (keyword =='') {
alert('You must have a valid and available keyword.');
break;
} else {
saveVCard();
break;
}
}
});
function saveVCard(){
// alert(form_1.getItemValue('id'));
// alert(gr_vCard.getSelectedRowId());
if (form_1.getItemValue('newVC')==1){
vCards.add({
keyword:form_1.getItemValue('keyword')
});
} else { form_1.save(); }
}
var vCards = new dhtmlXDataStore({
url:"dp-vcard.php",
datatype:"xml"
});
vCardDP = new dataProcessor("dp-vcard.php");
vCardDP.init(vCards);
vCardDP.setTransactionMode("POST",true);
vCardDP.enableDataNames(true);
gr_vCard.sync(vCards);
form_1.bind(gr_vCard);
vCards.data.attachEvent("onIdChange", function(old_id, new_id){
form_1.setItemValue('id',new_id);
form_1.setItemValue('newVC',0);
});
I’m not sure if this is a DataStore or a Grid/Form binding issue, but the error is occuring in the datastore.js file.
Thank you for your help!
Rob