I'm new to react and data grid, but have been able to successfully create patterns based on the documentation for adding rows, removing rows, and editing rows. The only issue I've run into is that I seem to have a problem when the data grid is initially empty and I want to add the first row. When I click on the Save button that contains the GetChangedLines after entering my data in the empty row, GetChangedLines throws the error "Cannot convert undefined or null to object." Is there some part of the pattern I'm missing when a data grid is initially empty? Do I need to do something prior to calling GetChangedLines if the data grid is starting from an initially empty state?
Hi Lennie,
Meanwhile, the OutSystems team is investigating the case. I do have a solution to suggest. Based on my observation, I understood that the underlying javascript implementation fails to handle the serialized JSON object of the Aggregate output list containing computed (Adhoc) attributes.
Implementation Steps:
See this demo implementation: DataGrid | Orders
Refer to the attached .oml file
I hope this helps you!
Kind regards,
Benjith Sam
Hey Lennie,
Thank you for bringing this topic into discussion. I've tried reproducing the scenario you mentioned, but I didn't get an error. Could you please send a sample so I could try to understand what's going on your side?
Best regards,
Gabriel Lundgren
Hey, Gabriel.
I created a simple Order/Line Item application and was able to duplicate the same scenario that I have in my larger application. I think I must be doing something wrong, but I'm not sure what it is.
Lennie Sutton
It seems we are the ones doing something wrong. We'll have a look at this issue and let you know how to proceed as soon as possible.
Hi, Benjith,
Thank you so much for the suggestion and example. I've applied this pattern to my particular use-case and it worked perfectly! I think I will just adopt this pattern whenever I use data grid.
Lennie
You're welcome, Lennie.
Glad to help you :)