I have an ag-grid (free reactjs version) with lots of columns and records to load.
Some columns are not necessary, so the user can drag the columns out of the grid (and hence hide them). This is fine but how can the user show the hidden columns again without refreshing the page?
I don't want to suppress column drag, just a way to undo the hide without refreshing.
Any advice?
Shameless plug: The enterprise version has this feature in two places, Tool Panel and Column Menu.
However, thankfully it is rather easy to implement this feature yourself using a single columnApi
call, well... one of these:
resetColumnState()
setColumnVisible(colKey, visible)
setColumnsVisible(<Array> colKeys, visible)
setColumnState
setColumnState(<Array> columnState)
Basically I can see you doing one of two things:
gridOptions.columnApi.resetColumnState()
when it is clicked -- OR --
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With