Hi guys, i have an interesting problem with my RDT, I need to be able to hide and show RDT columns as needed but I don’t have any idea about how to do that, I saw in the documentation that it is possible to create the RDT with columns already hidden, but that is not the solution that I’m looking for, any idea or suggestion?
Hide and show RDT columns programmatically
emoya
#2
Hi @davisg that’s so easy just let me show a piece of code:
let hide = function (event) {
let rdt = cf.getVisualization('your_chart_id');
rdt._visualization.gridOptions.columnApi.setColumnVisible('your_field', false)
};
let show = function (event) {
let rdt = cf.getVisualization('your_chart_id');
rdt._visualization.gridOptions.columnApi.setColumnVisible('your_field', true)
};
Remember that the RDT is an ag-grid based visualization.