[Data Grid Reactive] Real Time Grid Info on change
Forge component by OutSystems R&D

I implemented the add rows and delete rows functions to my DataGrid, but I would like to be able to access Grid info such as NumberofRows after doing so. 

Something like:

getElementByID('grid').rows.length;

Is there any way to do this?
 

Thank you

Solution

Hello @Takeru Mazuelos 

If you want to get the number of rows in the Data Grid you can use this JS line inside a JS node:

GridAPI.GridManager.GetGridById($Parameters.GridId).provider.itemsSource._src.length

Please let us know if this helps.

Thanks,

Bruno Martinho

Yes, thank you!

Sorry for the begginner question.

@Takeru Mazuelos 

No need to say sorry. Actually this is a good feedback, do you think it would be helpful to have a client Action in the GRID API that would return the number of rows in the grid?

Bruno Martinho

I think It would be quite useful. Although It can already be done by the JS line you mentioned before, it is quite hard to find and understand the code in GridAPI.GridManager, and I think that it would help people with less background knowledge in JS.

That being said, I think it is a low priority implementation, since most of the people using Outsystems already have a certain level of JS.

Thanks for all your hard work on the Data Grid Reactive Forge component! Very professional and easy to use.


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