Hi there,
I have a grid with a field with a custom editor. This editor consists of an input field, and I have applied validation to this using the HTML5 attributes (required, min, etc). The field uses data-bind syntax to get/set the data.
This works correctly and I get an error message when updating the field with invalid values.
However there appears to be a big flaw to how this works, the data-binding occurs BEFORE the validation it would seem.
Even if I enter an invalid value. the change event still fires on the dataSource and the new invalid value is set.
This seems to me to be unwanted behaviour, if there is an invalid value I do not want this set in the datasource.
Is this by design? How can I stop the data source updating on a validation failure?
Thanks in advance,
David Asbury.
ps. It is also possible to bypass the validator simply by pressing the escape key. This kills the validation message and removes focus from the invalid control. This also seems like a bug.
I have a grid with a field with a custom editor. This editor consists of an input field, and I have applied validation to this using the HTML5 attributes (required, min, etc). The field uses data-bind syntax to get/set the data.
This works correctly and I get an error message when updating the field with invalid values.
However there appears to be a big flaw to how this works, the data-binding occurs BEFORE the validation it would seem.
Even if I enter an invalid value. the change event still fires on the dataSource and the new invalid value is set.
This seems to me to be unwanted behaviour, if there is an invalid value I do not want this set in the datasource.
Is this by design? How can I stop the data source updating on a validation failure?
Thanks in advance,
David Asbury.
ps. It is also possible to bypass the validator simply by pressing the escape key. This kills the validation message and removes focus from the invalid control. This also seems like a bug.