[Data Grid Reactive] How do I get the number of rows being edited?
Question
Forge component by OutSystems R&D

Hi, guys,


I want to show the user the number of rows being edited.

However, the number of EditedLines retrieved from GetChangedLines is inaccurate!

How can I get the exact number of rows that are being edited in DataGridReactive?


Best Regards,


Nakata

CanNotGetEditRowLength.oml

Solution

Hello ,

Can you please check if this sample helps you?

https://www.outsystems.com/forums/discussion/71471/how-to-set-value-into-aggregate-when-data-changed/#Post291645

I believe this can solve your current problem.

Thanks,

Bruno Martinho

Hi Martinho,


Thank you for the sample.

With this sample, I was able to display the exact number of cases.


I understand that I need to add BlurAction and SelectCellAction.

Is that correct?


Best Regards,

Nakata

Hello @Shohei Nakata,

The Blur action and SelectCell don't exist in the current Data Grid component, but you can copy and paste from the sample to your project and use it.

Hopefully this can help you achieve your use case,

Bruno Martinho


Hi Nakata,

The GetChangesLines is inaccurate because you're using it in the OnChange action of the cell. When the OnChange action is running, the line is still not considered changed, hence it doesn't give you what you are expecting.

If you change another line, you will see that the result will already say that you have changed 1 line (the first one) and will not take into account the second change. 

To get the expected result, you have to do this logic in an action other than OnChange.

Hope this helps.


Best regards,

André Dinis

Hi André,

thank you for your reply.

Which action should I use?  


Best regards, 

Nakata

Hi Nakata,

Can you explain your use case? Do you really need to know how many lines were changed when you change the Product Name cell? If so, why?

GetChangedLines action will give you what you want, but not if you use it in the OnCellValueChange event:

because of what I explained in the previous reply.

To try it out, if you put, for instance, a button somewhere in the screen and call your action (ProductNameOnCellValueChange) in the OnClick event of the button - something like this:

you'll see that you will get the correct value for the number of lines edited.

But again, without knowing your use case, I may not be helping you much. So if you could expose your use case in more detail, that would be great.


Best regards,

André Dinis

Hi Dinis ,

My User wants to know in real time how many lines are being updated at the moment.

So I would like to know the number of rows being updated at the time the data is changed.


Best regards, 

Nakata

Solution

Hello ,

Can you please check if this sample helps you?

https://www.outsystems.com/forums/discussion/71471/how-to-set-value-into-aggregate-when-data-changed/#Post291645

I believe this can solve your current problem.

Thanks,

Bruno Martinho

Hi Martinho,


Thank you for the sample.

With this sample, I was able to display the exact number of cases.


I understand that I need to add BlurAction and SelectCellAction.

Is that correct?


Best Regards,

Nakata

Hello @Shohei Nakata,

The Blur action and SelectCell don't exist in the current Data Grid component, but you can copy and paste from the sample to your project and use it.

Hopefully this can help you achieve your use case,

Bruno Martinho


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