I'm working on form, where I'm using knockout + knockout.validation framework. Now I'm stuck with the validation, because it is not working as expected. I created simple fiddle to show you my problem.
My viewModel is complex object with observable fields and .extend methods with validation. The validation itself works well, but counting of errors does not.
In sort, if I assign data to my viewModel on start like this:
self.someObject = ko.observable(new SomeObject({
id: "123",
name: {
en: "Initial data"
}
}));
everything is ok, but the call for accual data is asnyc call to WebApi. Therefore, the original object (viewModel.someObject) gets replaced when returned from server. The problem is, that once the object is replaced, viewModel.errors (which is validation group) stops keep tracking of errors.
You can see the full working example in JsFiddle example. Maybe I overlooked something important in JS (I'm more of a C# guy).
This is a big problem, because now I'm unable to stop saving of the data since I don't know if there is any error.
Thanks!