CollectionView Validation
The CollectionView has a getError property that provides validation support. To use it, set getError to a function that takes two parameters containing the data item being validated and the property to validate, and returns a string describing the error condition or null if there are no errors.
The getError property goes beyond basic HTML5 validation based only on the value itself (such as min, max, required, pattern, etc). It allows you to specify conditions that involve multiple properties.
The getError property allows you to include the validation logic in the collection itself, rather than in the UI used for editing items. The same method can then be used by input forms or by controls such as FlexGrid.
FlexGrid Validation
FlexGrid uses the CollectionView.getError property by default. Try entering an invalid country or a negative number to see how the grid identifies the error and prevents the invalid entry from being committed:
Forms Validation
You can use the the CollectionView.getError property to validate forms as well. Simply call the function and apply the result to the appropriate input element using the setCustomValidity method that is part of the HTML5 validation API.