FlexGrid Validation

When you use the CollectionView.getError method for validation, the FlexGrid will show errors in data cells and also in the row header cells.

By default, the row header cells will show all the errors in the item. To customize that behavior, return the error message you want to show for the row header when getError is called without a specific property (prop == null).

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: