Hi, I have a datatable, and action on editstop, I want to replace row id with new one, because when I add new row, it gets some value as id(looks like unixtimestamp+miliseconds), so I send request to add new entry, get id of entry in response, and replace old id in here " rowData[‘id’] = resp.id;" it works ok.
var groupsView = {
...
'onAfterEditStop': function(state,item) {
if(state.value != "" && state.value != state.old){
var post = {};
var rowData = this.getItem(item.row);
for (var key in rowData) {
post[key] = rowData[key];
}
webix.ajax().post("group", post, function(text){
var resp = JSON.parse(text);
if (resp.error != 0) {
rowData[item.column] = item.value;
....
}
rowData['id'] = resp.id;
});
}
}
},
},
but when I try to update another column of the same row, I’ve got error “Attempt to change ID in updateItem”.
So absolutey dont understand what is wrong or maybe you can help how to add new rows + send update to server with following editing of this row?