254
Views
5
Comments
Solved
[OutSystems Data Grid] How to get All Lines not only changed - DataGrid
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

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,

2024-05-20 09-45-12
Jean Bastos
Solution

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.


2021-01-19 14-07-32
Tom Zhao

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.

2021-01-19 14-07-32
Tom Zhao

Hi @Jean Bastos 

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,

2021-01-19 14-07-32
Tom Zhao

Hi 

I solved the problem. Use code bellow can get total row count.

OutSystems.GridAPI.GridManager.GetGridById($parameters.GridId).provider.rows.length

Regards,

2021-09-06 15-09-53
Dorine Boudry
 
MVP

@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

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