-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid Validation Implementation #11923
Conversation
… event for grid. Add default error template.
…hat validation states can be stored when bath editing is off.
On the tree grid add row sample, if you make the first two rows (with rowId 0 and 4) invalid. Afterwards if you call grid.validation.getInvalid() you will get an array with 2 invalid records. Then use the grid validation service clear method to clear only the validation errors of the first (grid.validation.clear(0)). Call again grid.validation.getInvalid() and observe that it returns empty array. This is because
the rowId is 0 and it is false. And the if block hits the else statement |
I think we should stick to what normal form groups do: the errors are specific to where the validation is - if there was a validator on the form group itself (cross-field), then I'd expect the row to have errors. Otherwise, the errors are under the specific cell and you can't really expose them on the row without changing the error type (since there would need to be indication for which field the error object is, which is a map of maps, essentially what row.cell.errors is already :) ) |
…Type. Add interfaces for new grid events that have owner. Fix small issue in clear API.
@mddragnev Issues should be fixed now. |
On the grid validation dev sample, when trying to add row make any of the cells invalid, the observe that |
projects/igniteui-angular/src/lib/grids/common/grid.interface.ts
Outdated
Show resolved
Hide resolved
<ng-template igxCellEditor let-cell="cell"> | ||
<input name="units" [(ngModel)]="cell.value" style="color: black" /> | ||
<ng-template igxCellValidationError let-cell='cell'> | ||
<div *ngIf="cell.formGroup?.get(cell.column?.field).errors?.['forbiddenName']"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit of a left over, can be fixed later though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a few bits to clean up around ARIA and dev demos, but overall LGTM
Closes #6501
TODO:
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)