Hi everyone,
I’m working on a Reactive app where an OML consumes an API to fetch project-related data. In the Data Grid, rows are auto-filled when the user types a Name in the corresponding column (using OnCellValueChange + SetCellData). That part works fine.
Now I want to persist/safe any rows the user adds, or edits/changes the user makes. It should open, the next time the Datagrid is published.
My plan:
Questions:
What I’ve tried:
Thanks in advance for any guidance or examples! Your help so far in other threads has been super valuable.
Hi,
Your approach is partially correct, using GetChangedLines and then deserializing the lists is fine. The issue was in your SaveList server action. You need to call the corresponding action depending on the type of change:
Create (CreateData in your case) for new rows
Update for modified rows
Delete for removed rows
You can use CreateOrUpdate for both inserts and updates, but for performance and clarity it’s better to keep Create and Update separated.
I also adjusted how you handle the inputs by splitting them into three separate input lists, so you no longer need to use ListFilters afterward.
I’ve attached the updated OML, let me know if it works on your side.
Thank you Mihai! Your approach worked perfectly fine