Server-side validation ?

With a form binded to a datatable; I managed to display server-side error messages for a form (using a custom response embedding errors for each field):

dp.attachEvent('onAfterSaveError', function(id, action, response) {
  Object.keys(response.errors).forEach(function(field) {
    $$('myform').markInvalid(field, response.errors[field][0] );
  });
});

But (due to the binding ?) the table is updated before the response comes back.

What would be the best strategy to make the table updates after the (server-side) validation process ?

Yes, the Webix API is optimistic by default, so all client side updates are goes without waiting for server side confirmation.

You can replace the automatic data binding with manual setValues, getValues, getItem, updateItem calls. In such case you can use onAfterSave handler of dataprocessor for updating the master component.

I’m not sure I understand how to do this, but reloading the table after each operation is a workaround I can live with for now.

Not pretty but it works.

I’ll deal with this issue later… ( And I have now a Webix licence: so expect a long mail in the following weeks :slight_smile: )

Thanks for your answer.