236
Views
4
Comments
Solved
[OutSystems Data Grid] How to remove columns?
Application Type
Reactive

Hi!

How can I remove columns from the Outsystems DataGrid component? Or from the aggregate that is the source of the Grid?

I don't want to show all columns from my tables to the users...

Thanks!

2023-03-08 10-32-19
Vinod Kumar R
Solution

Hello @Diogo Barbosa 


If you are using JSON data directly as grid source you might have to use javascript to hide columns. 

Other way is: 

1) create a structure with required columns as mentioned by @Dorine Boudry

2) Bound the aggregate output to your variable list (structure)

3) Then call the ArrangeData with the same variable (structure) list

4) Get the JSON output with required column and bound to Grid source

5) Add the columns to Grid manually and bind the headers


Attached is the OML for your reference

Regards,

Vinod

Grid.oml
2023-11-10 11-46-42
Diogo Barbosa

Wonderful example man!

Thank you!!

2022-06-23 06-21-50
Siddharth Vyas
2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Diogo Barbosa ,

do you mean when you are using auto generated columns ?  I guess, make a structure representing the data you want in the grid, move the result of your aggregate to a variable of list of that structure, and then use that variable as the source for your grid.

Dorine

2023-03-08 10-32-19
Vinod Kumar R
Solution

Hello @Diogo Barbosa 


If you are using JSON data directly as grid source you might have to use javascript to hide columns. 

Other way is: 

1) create a structure with required columns as mentioned by @Dorine Boudry

2) Bound the aggregate output to your variable list (structure)

3) Then call the ArrangeData with the same variable (structure) list

4) Get the JSON output with required column and bound to Grid source

5) Add the columns to Grid manually and bind the headers


Attached is the OML for your reference

Regards,

Vinod

Grid.oml
2023-11-10 11-46-42
Diogo Barbosa

Wonderful example man!

Thank you!!

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