Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Tree Grid - Validation on new row preventing users clicking away
posted

We have created an example of a tree grid here: Tree Grid Validation - Row Edit - StackBlitz for adding and editing rows and has validation added for required fields. What we have noticed happening is that when you edit a row, and have incorrect data, the validation will kick in and not allow you to leave the row, this is the same when you add a new row and enter incorrect data. However, if you add a new row and then immediately click off it, this new row will be added even though the required fields have not had any data entered into them. The cells will be highlighted to show there are validation errors but not until the row has been added to the grid. So how can we go about stopping users from being able to do this? Is there a new even that should be added so validation will kick in even though the user hasn't started typing anything?