Hi
Is there any way to get all lines data as JSON instead of the Changed Lines only?
I already show the similiar question bellow. But there no answer.
https://www.outsystems.com/forums/discussion/71823/outsystems-data-grid-get-all-lines-not-only-changed-datagrid/
My use case is that I need to first import the DataGrid data from an uploaded CSV file, then edit the values, and finally save all the data to the database.
Regards,
without javascripts... just Create a new hidded checkbox column, and when you hit save runs a logic like this one to change all before send it to database.
Hi @Jean Bastos
Thanks for your reply. I understand your solution, but if there is another way to do it, even with JavaScript, please let me know.
Sorry to bother you again. But it seems that SetCsvData always returns success, even when CurrentRow exceeds the total number of rows.
Can you tell me how to get total row count ?
Best Regards,
I solved the problem. Use code bellow can get total row count.
OutSystems.GridAPI.GridManager.GetGridById($parameters.GridId).provider.rows.length
@Tom Zhao ,
Faking a change will work, just adding an alternative way of looking at it :
have a local list representing data coming from the CSV as your temporary 'truth' as long as you have not saved to the database.
when user is choosing to save, get the changed lines from the grid, work them into that local 'truth' (by some identifying attribute), then that local list is the source for your database update.
This might be quicker / cleaner if most of the time, the user makes very little changes.
Dorine