updateFromResponse Bind Form ID field not updated

Hello. I have a Datatable and a Form bound to it. When I add a new element to the datatable, the element gets a temporary ID, the server-side script sends back the new ID (updateFromResponse:true). The datatable is updated (showing the Id returned by the server) but the Form still has the old Id. Is there a callback function which is triggered when the server sends the response back with the new Id?
I would also like the new element to be selected automatically when added (.showItem(id), .select(id), .setCursor(id)). Here again, I need a way to trigger this selection once the NEW id is sent back by the server.
Any help would be appreciated.
Thanks.

The following seems to work. Please let me know if it’s the best option:


<code class="js">
var dp = webix.dp("myDatatable");
dp.attachEvent('onAfterSync', function(id, text, data){
			var response = data.xml(),
			hash = response.data;
			if(hash.action.type == "insert")
			{
				$$("myFormIdField").setValue(hash.action.tid);
			}     
													});
`

Kind regards.

Not good… Considered as a modification of the Id field of my form and therefore the form’s data becomes dirty. Cleaning the form puts the temporary Id back.

There is onIdChange event

dtable.data.attachEvent("onIdChange", function(oldid, newid){ });

Still, I think the id must be updated in the form automatically. Which version of Webix you are using ? Are you linking form to grid by bind command ?

I’m using Webix v1.9. The form is linked to the datatable using bind command. Selecting another item in the datatable and reselecting the new item does the trick (but is not acceptable for user experience). Should I update the Webix version? Are there any side effects to expect?

Try to use Webix 1.10, there was at least one fix related to data binding, it may resolve the above issue.

New version is backward compatible, so replacing webix.js and webix.css files must be enough.

Update to v1.10. Same issue.

I was able to reconstruct the issue.
Fix will be included in the next build ( id of linked form will be updated automatically, after data saving in the master component )

Great! Thank you for your feedback.