adding a row, and then editing that new row

I add a row to my grid as follows:

var newId = insGrid.uid();
insGrid.addRow(newId[insId,desc,amt,currentUserID],0);

If I then try to edit the new row, it doesn’t get saved to my database. I think this is because my grid does not yet know the value that was assigned by my database to the automatically incrementing database field: insId.

I am able to fix this issue by:

var newId = insGrid.uid();
insGrid.addRow(newId[insId,desc,amt,currentUserID],0);
insGrid.updateFromXML("…

This now allows me to edit my new row and successfully save it to my database. I think this is because my grid now knows the id for the row in the database, whereas it doesn’t know the id without the 3rd row shown above.

However, this causes me to need to communicate a 2nd time with the server. Is there a way to avoid having to do this updateFromXML for the sole purpose of grabbing the id? I think I may not be grasping the purpose and method of using .uid().

Thank you.

Unfortunately the issue cannot be reconstructed locally.
Here you can find a working example:
dhtmlx.com/docs/products/dht … _once.html

If issue still occurs for yiou - please, provide us with any kind of sample of the code or a complete demo where the issue can be reproduced.