Open lcorneliussen opened 12 years ago
@lcorneliussen
I'm interested - but not sure I'm grasping what you're trying to describe without seeing it.
I've had on my list of "TODOs" for while to take a deeper look at the traverse
logic on the group function. It would be relatively easy to add some more intelligence to that in the form of:
hasVisited
array and checking each node against that before walking ittry/catch
handlers in case things go awry traverse
function out into a named function separate from the group
function so that we can write tests on itThose were my ideas - any interest on blending the 2?
I don't like my approach, but it works for me now.... Would you have a look at it?
Approach is to keep a list of children pr. "node" in the validation tree... Then combine those lists using ko.computed - on the root...
I have a simple solution for deep validation knockout, may be can help you. https://github.com/Hernandesjunio/KnockoutModelChainValidation
I have a couple of problems with the current validation engine:
I have a draft locally which fixes the first to problems by explicitly telling ko.validation which path to follow when validating. Currently this is done by extending with
{ followOnValidation: true }
.It will then also subscribe to those extended objects and update the "validatables" for the group correspondingly.
What do you think of that approach?