Attempt to change ID in updateItem

I have a datatable that is bind to a form. When I update the record it works fine but if I try to update the same record I get an “Attempt to change ID in updateItem”. I assume that it is because it trying to update the ID field that is already generated. A work around for it was to unset the array “id” after the variable has been set. Is there a better way of doing the below?

var Datatable = $$('table');
var Selected = Datatable.getSelectedId(); 
if (!Selected) return;
var FormData = $$('myform').getValues();
delete FormData['id'];
Datatable.updateItem(Selected, FormData);

Here’s the quick sample of data binding:

http://webix.com/snippet/61a26c6a

In such case, the form receives only the data for corresponding inputs, nothing more.

If you set the data to the form manually, perhaps the best way is to usegetDirtyValues for data saving. This method will return only changed values. Something like this:

http://webix.com/snippet/069512bb