2
votes

I'm using knockout validation plugin in order to perform validation of my model.

I created a knockout extender that allows me to validate user input on additional observable rather then on the model directly. The concept is to avoid changing the model until the input is valid. Imagine that user is populating money field - they can make mistakes as they type and the value would resolve in NaN and that would trigger updates to computed observables etc. So I'm only taking validated values.

My problem is that I don't know how to make my extender to work with deep group validation in knockout validation. I understand that validation traverses through the tree and it doesn't go into my additional observable.

In order to demonstrate my problem I have mocked a quick jsfiddle: http://jsfiddle.net/maciej/WtDRS/

My extender is called myNumber. This extender will later evolve to money, date, percent extenders etc.

Any ideas? Thanks

1

1 Answers

2
votes

do you need to enable deep group validation?

ko.validation.configure({
   grouping: {
       deep: true
   }
});