Select row with “a2” from the table and press “Do something” on the form. After two seconds the value “b2” will change to “b2 changed” but it is changed on the datatable only.
Because this does not work I tried to find a event that is fired on the datatable as soon as the row changes to update the form manually but I had no luck. I had no luck trying to follow the source either.
The following should work for form-collection binding:
form.save();
or
collection.updateItem(data.getCursor(), newData);
However, there is the issue with updateItem in minified webix.js ( updateItem works with webix_debug.js). We will include the fix into the next minor update.
form.save() is updating the collection bound to the form which works fine. collection.updateItem is what doesn’t work (even with webix_debug-js). It updates the collection and the grid receives the update but the form bound to the grid does not. This is what my example demonstrates.
We are working with event messaging which means if I call form.save() the message gets passed to the server and the job is done (no reply). Later a message arrives from the server with the updated data and this is where I have to update the collection and anything directly (grid) or indirectly (form).
I tried this too but this does not help in my case because the part that updates the datacollection has no idea about what is bound to it (I think that’ s one of the main points for using a binding).
To use refreshCursor() I need to know that the data has changed. I was unable to find an event that is fired on the datatable after a collection.updateItem() which means I don’t know when I have to call refreshCursor() because the data has changed.
yes, this is what I did as a workaround but I am not sure if I like this solution. The binding to the datatable looks much cleaner to me because this is where the form receives it’s data from. Just thought I was doing something wrong for the binding not working as I thought it should.
However, if there is no solution to get the datatable binding working, this solution is fine with me.