ericmbarnard/Knockout-Validation — pull request #226 by delixfe (2013-02-08 20:00:43+00:00)
Title: Returning error details instead only the error message in group.errors

I work currently in a project where we have the requirement to show all errors in a list.
![errorDetails](https://f.cloud.github.com/assets/654498/140634/7a44b2ca-7227-11e2-9961-476d820affb4.PNG)
The errors can come from several tabs. A click on a link (blue) opens the correct tab and focuses the corresponding input field.

knockout.validation currently does not support such scenarios because ```group``` only returns error messages as strings.

That pull requests extents knockout.validation.group to return error detail objects instead only strings.

That is enabled with a new configuration option: ```enableErrorDetails```
If it is set to true then validateables will be extended with an property ```errorDetails``` which contains the following values:

``` javascript
if(configuration.enableErrorDetails) {
// holds detailed error information
observable.errorDetails = {
rule: ko.observable(null),
params: ko.observable(null),
observable: observable,
message: ko.observable(null)
};
}
```

Setting ```enableErrorDetails``` to ```true``` also lets ```group.errors``` return an observable array of errorDetails objects instead of strings. That gives the power to build more complex error lists.

The changeable properties of errorDetails are knockout observables. That solves the problem that the errors of the result of validation.group are not correctly updated if only the type of the error changes, e.g. going from a required to a minimum length error (as described in #218).