[Data Grid Reactive] Validate Data Grid
Forge component by Bruno Martinho
Application Type
Reactive

Hello,

I am trying to validate my Grid before saving changes. Using the Data Grid samples and examples I managed to set everything working including settings validations for inputs.

I used SetDataValidation for each Data Grid Cell correctly but I can't seem to find a way to prevent user to save these invalid records.

Firstly I tried to save a isGridValid variable but since there can be multiple invalid cells whenever user corrected one cell, it is turning isGridValid to true, when it is not.

Then I tried to save a list of the invalid cells but when the user adds or removes a new row it would change the cells that were saved as invalid.

The column must only have unique values

Can someone tell me the easiest way to perform this validation?


Best Regards,

Pedro

Solution

Hello @Pedro SoaresP,

The Grid component has a client action that retrieves the changes that exist in the Grid.

Are you already using this action?

If you are, let us a know a little bit better the use case, so we can try to help,

Thanks,

Bruno Martinho

Hello, Bruno.


Thank you for the fast answer. I did not know about it but now I tested and I don't know what I am doing wrong.

My Grid clearly has an invalid cell as shown

But it shows has not having any invalid lines


Regards,

Pedro

Hello @Pedro SoaresP,

Indeed there is a known issue that will be solved in the next release, early next week.

Please check this forum post, it has the current workaround.

https://www.outsystems.com/forums/discussion/70046/the-json-conversion-of-hasinvalidlines-property-is-wrong/#Post282837

Sorry that I pointed in this directions and didn't mention the known issue.

Please let me know if this helps.

Bruno Martinho

Thank you. I still considered your answer as the solution as there was another opened topic about the same subject.

Also thank you for the amazing component, I am loving it. The samples are amazing.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.