I created a UI Grid with validations. I append an empty row for the user to fill out. It looks like the validations only happen on edit. It seems valid that the empty row is not flagging validations from the start because the user has not had any interactions with the cell yet - however if a user starts to edit a cell - but then decides not to - the validations still do not take place.
There are two scenarios I would like to support:
- An empty 'new' row
- No visual validation failures
- User starts an edit - but then clicks away without making any changes
- Validation failures are visible
- An existing row that is invalid
- Load data with that doesn't pass validations
- Validation failures are immediately visible without any user interaction
Plunker: http://plnkr.co/edit/cb9Vb9b4iTC8z4haahbL?p=preview
$scope.gridOptions.columnDefs = [
{ name: 'id',
enableCellEdit: false,
width: '10%'
},
{ name: 'name',
displayName: 'Name',
width: '20%',
validators: {
required: true,
startWith: 'M'
},
cellTemplate: 'ui-grid/cellTitleValidator'
},
{ name: 'gender',
displayName: 'Gender',
width: '20%',
validators: {
required: true
},
cellTemplate: 'ui-grid/cellTitleValidator'
}
];