Remove columns in dgrid dynamically

118 Views Asked by At

I am creating a dgrid using columnHider. I was able to hide/show columns using this.dgridTable.toggleColumnHiddenState(columnId, hidden);

However, I want to altogether remove specific columns from view(including the column hider menu). Is there a way to do this without re-creating the grid with a new set of columns?

1

There are 1 best solutions below

2
Jean-Claude Hujeux On BEST ANSWER

You should be able to use this.dgridTable.set('columns', newColumnsDescription);. It does update the column hider menu as well.

You will have to build newColumnsDescription to reflect the addition / removal of columns as per your needs.