[Data Grid] How to manipulate column visibility?

Forge Component
(32)
Published on 4 Dec (2 days ago) by OutSystems R&D
32 votes
Published on 4 Dec (2 days ago) by OutSystems R&D

Hi,

I need to have ability to manipulate column and rows visibility based on the header value. I can change .visible attribute of specific column but that update is not reflected on the screen. I've trie greed refresh and refresh Cells functions but with no success. What is the correct way of manipulating column / rows or cells attributes and get them reflected on the screen grid?

Thank you.

After some research and fails working way of manually manipulate columns visibility is this:
GridOS.ComponentUtils.getGridObjectById('*****Grid element Id*****').grid.columns.map(function(col) {

//anything you want to do with column. for example toggle visibility by having text
if (col._binding._key.includes("serachText")){

   col.visible = !col.visible;

}

  })