Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

458
Views
Setting Column Visibility in AgGrid React

I have a BE that returns an Array of objects (columns) in React. The objects are structured like this {headerName: 'string', field: 'string', visible: boolean}. The visible parameter doesn't actually do anything as the column will always be visible. I know in AgGrid the Column Object has a visible parameter which if changed shows or hides the column. How can I make AgGrid use the visible parameter the backend gives me? Am I using the wrong strategy here? How would you do it? As far as changing the object returned by the backend and AgGrid settings.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

use useMemo and recreate the columnDefs when needed:

Demo

about 4 years ago · Juan Pablo Isaza Report

0

To hide/show a column in AG Grid, you have to set the hide property on the column: https://www.ag-grid.com/javascript-data-grid/column-properties/#reference-display-hide

enter image description here

Since your server is returning visibility, I would suggest either of the two approaches:

  1. On the client side - Add a function to modify the data returned from the server, such that visibility is renamed to hide
  1. On the server side - the response object for the data should have the hide property
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!